dchat/docker-compose.yml
Augusto Dwenger J. f0d6c40e65 build: Add new monolith module
Includes a small refactoring of the Dockerfile to make the build
easier to read.
Use the new monolith in the local Docker Compose setup.
2024-02-17 16:22:16 +01:00

93 lines
1.6 KiB
YAML

version: "3"
services:
monolith:
image: git.hhhammer.de/hamburghammer/dchat/monolith:latest
env_file:
- .env
build:
dockerfile: Dockerfile
context: .
target: monolith
restart: unless-stopped
networks:
- db
- web
ports:
- 8080:8080
user: 1000:1000
depends_on:
- db
- migration
migration:
image: git.hhhammer.de/hamburghammer/dchat/migration:latest
env_file:
- .env
build:
dockerfile: Dockerfile
context: .
target: migration
user: 1000:1000
depends_on:
- db
networks:
- db
ui:
image: git.hhhammer.de/hamburghammer/dchat/ui:latest
build:
dockerfile: Dockerfile
context: .
target: ui
restart: unless-stopped
ports:
- 8081:80
networks:
- ui
caddy:
image: git.hhhammer.de/hamburghammer/dchat/caddy:latest
build:
dockerfile: Dockerfile
context: .
target: caddy
restart: unless-stopped
user: 1000:1000
depends_on:
- ui
- monolith
ports:
- 8082:8080
networks:
- ui
- web
volumes:
- caddy_config:/config
db:
image: docker.io/postgres:15-alpine
env_file:
- .env
restart: unless-stopped
ports:
- 127.0.0.1:5432:5432
networks:
- db
volumes:
- ./data/postgres:/var/lib/postgresql/data:rw
healthcheck:
test: [ "CMD-SHELL", "pg_isready", "-d", $POSTGRES_DB ]
interval: 10s
timeout: 5s
retries: 5
start_period: 60s
volumes:
caddy_config:
networks:
db:
ui:
web: