Skip to content

Commit

Permalink
Merge branch 'main' into release-please--branches--main
Browse files Browse the repository at this point in the history
  • Loading branch information
grigoriev authored Sep 20, 2024
2 parents 4db3976 + 77defa2 commit 89e8f7d
Showing 1 changed file with 61 additions and 8 deletions.
69 changes: 61 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,87 @@
# WeasyPrint Service
Service providing REST API to use WeasyPrint functionality

## Build Docker image
A Dockerized service providing a REST API interface to leverage WeasyPrint's functionality for generating PDF documents
from HTML and CSS.

## Features

- Simple REST API to access WeasyPrint
- Compatible with amd64 and arm64 architectures
- Easily deployable via Docker

## Getting Started

### Installation

To install the latest version of the WeasyPrint Service, run the following command:

```bash
docker pull ghcr.io/schweizerischebundesbahnen/weasyprint-service:latest
```

### Running the Service

To start the WeasyPrint service container, execute:

```bash
docker run --detach \
--publish 9080:9080 \
--name weasyprint-service \
ghcr.io/schweizerischebundesbahnen/weasyprint-service:latest
```

The service will be accessible on port 9080.

### Using as a Base Image

To extend or customize the service, use it as a base image in the Dockerfile:

```Dockerfile
FROM ghcr.io/schweizerischebundesbahnen/weasyprint-service:latest
```

## Development

### Building the Docker Image

To build the Docker image from the source with a custom version, use:

```bash
docker build \
--build-arg APP_IMAGE_VERSION=62.4.3 \
--build-arg APP_IMAGE_VERSION=0.0.0 \
--file Dockerfile \
--tag weasyprint-service:62.4.3 .
--tag weasyprint-service:0.0.0-test .
```

## Start Docker container
Replace 0.0.0 with the desired version number.

### Running the Development Container

To start the Docker container with your custom-built image:

```bash
docker run --detach \
--publish 9080:9080 \
--name weasyprint-service \
weasyprint-service:62.4.3
weasyprint-service:0.0.0-test
```

## Stop Docker container
### Stopping the Container

To stop the running container, execute:

```bash
docker container stop weasyprint-service
```

## Access service
### Access service

Weasyprint Service provides the following endpoints:

------------------------------------------------------------------------------------------

#### Getting version info

<details>
<summary>
<code>GET</code> <code>/version</code>
Expand All @@ -51,6 +103,7 @@ Weasyprint Service provides the following endpoints:
------------------------------------------------------------------------------------------
#### Convert HTML to PDF
<details>
Expand Down

0 comments on commit 89e8f7d

Please sign in to comment.