Skip to content

Commit

Permalink
chore(docker): fix small Compose files issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ncarlier committed Dec 24, 2023
1 parent 4debcbc commit 48c72e9
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 28 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ docker run -it --rm \
docker compose up
```

> The default Docker Compose file mounts a passwd file with a `demo` user having `demo` as password.
## Configuration

Readflow configuration is a TOML file that you can specify using the `--config` command line parameter or by setting the `READFLOW_CONFIG` environment variable.
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
ports:
- "${POSTGRES_PORT:-5432}:5432"
#######################################
# Imagor: Image proxy
# Imgproxy: Image proxy
#######################################
imgproxy:
image: darthsim/imgproxy
Expand All @@ -23,11 +23,11 @@ services:
IMGPROXY_SALT: ${READFLOW_HASH_SECRET_SALT:-706570706572}
IMGPROXY_ENABLE_WEBP_DETECTION: true
ports:
- "${IMAGOR_PORT:-8081}:8080"
- "${IMGPROXY_PORT:-8081}:8080"
#######################################
# Goenberg: PDF generator
#######################################
gotenberg:
image: gotenberg/gotenberg:7
ports:
- "${GOTENBERG:-3001}:3000"
- "${GOTENBERG:-3001}:3000"
64 changes: 64 additions & 0 deletions docker-compose.extra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
version: "3"

services:
########################################
# PostgreSQL
########################################
db:
image: postgres:14
restart: always
environment:
- POSTGRES_DB=${POSTGRES_DB:-readflow}
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-secret}
volumes:
- db-data:/var/lib/postgresql/data

#######################################
# Imgproxy: Image proxy
#######################################
imgproxy:
image: darthsim/imgproxy
environment:
IMGPROXY_KEY: ${READFLOW_HASH_SECRET_KEY:-736563726574}
IMGPROXY_SALT: ${READFLOW_HASH_SECRET_SALT:-706570706572}
IMGPROXY_ENABLE_WEBP_DETECTION: true
logging:
driver: "json-file"
options:
max-size: "1m"
restart: always

#######################################
# Gotengerg: PDF generator
#######################################
gotenberg:
image: gotenberg/gotenberg:7
restart: always

########################################
# readflow
########################################
readflow:
#build: .
image: "ncarlier/readflow:edge"
restart: always
depends_on:
- db
ports:
- "${PORT:-8080}:8080"
environment:
- READFLOW_DATABASE_URI=postgres://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-secret}@db/${POSTGRES_DB:-readflow}?sslmode=disable
- READFLOW_METRICS_LISTEN_ADDR=:9090
- READFLOW_IMAGE_PROXY_URL=http://imagor:8080
- READFLOW_PDF_SERVICE_PROVIDER=http://gotenberg:3000/forms/chromium/convert/html
- READFLOW_AUTHN_METHOD=basic
- READFLOW_AUTHN_BASIC_HTPASSWD_FILE=file:///var/local/demo.htpasswd # "demo" as username and password
volumes:
- ${PWD}/var/demo.htpasswd:/var/local/demo.htpasswd

networks:
default:

volumes:
db-data:
27 changes: 2 additions & 25 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,6 @@ services:
volumes:
- db-data:/var/lib/postgresql/data

#######################################
# Imgproxy: Image proxy
#######################################
imgproxy:
image: darthsim/imgproxy
environment:
IMGPROXY_KEY: ${READFLOW_HASH_SECRET_KEY:-736563726574}
IMGPROXY_SALT: ${READFLOW_HASH_SECRET_SALT:-706570706572}
IMGPROXY_ENABLE_WEBP_DETECTION: true
logging:
driver: "json-file"
options:
max-size: "1m"
restart: always

#######################################
# Gotengerg: PDF generator
#######################################
gotenberg:
image: gotenberg/gotenberg:7
restart: always

########################################
# readflow
########################################
Expand All @@ -49,9 +27,8 @@ services:
- "${PORT:-8080}:8080"
environment:
- READFLOW_DATABASE_URI=postgres://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-secret}@db/${POSTGRES_DB:-readflow}?sslmode=disable
- READFLOW_LISTEN_METRICS=:9090
- READFLOW_IMAGE_PROXY_URL=http://imagor:8080
- READFLOW_AUTHN=file:///var/local/demo.htpasswd
- READFLOW_AUTHN_METHOD=basic
- READFLOW_AUTHN_BASIC_HTPASSWD_FILE=file:///var/local/demo.htpasswd # "demo" as username and password
volumes:
- ${PWD}/var/demo.htpasswd:/var/local/demo.htpasswd

Expand Down

0 comments on commit 48c72e9

Please sign in to comment.