Reactive-Resume/docker-compose.yml

59 lines
1.5 KiB
YAML

version: '3'
services:
postgres:
image: postgres
container_name: postgres
ports:
- 5432:5432
env_file: .env
volumes:
- pgdata:/var/lib/postgresql/data
traefik:
image: traefik
container_name: traefik
command:
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --entrypoints.web.address=:80
ports:
- 80:80
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
server:
image: amruthpillai/reactive-resume:server-latest
container_name: server
env_file: .env
environment:
- PUBLIC_URL=http://<SERVER-IP>
- POSTGRES_HOST=postgres
depends_on:
- traefik
- postgres
labels:
- traefik.enable=true
- traefik.http.routers.server.entrypoints=web
- traefik.http.routers.server.rule=Host(`<SERVER-IP>`) && PathPrefix(`/api/`)
- traefik.http.routers.server.middlewares=server-stripprefix
- traefik.http.middlewares.server-stripprefix.stripprefix.prefixes=/api
- traefik.http.middlewares.server-stripprefix.stripprefix.forceslash=true
client:
image: amruthpillai/reactive-resume:client-latest
container_name: client
env_file: .env
environment:
- PUBLIC_SERVER_URL=http://<SERVER-IP>/api
depends_on:
- traefik
- server
labels:
- traefik.enable=true
- traefik.http.routers.client.rule=Host(`<SERVER-IP>`)
- traefik.http.routers.client.entrypoints=web
volumes:
pgdata: