Reactive-Resume/docker-compose.yml

72 lines
1.8 KiB
YAML
Raw Normal View History

2022-03-02 16:44:11 +00:00
version: '3'
services:
postgres:
2022-03-02 16:44:11 +00:00
image: postgres
container_name: postgres
2022-03-02 16:44:11 +00:00
ports:
- 5432:5432
env_file: .env
2022-03-02 16:44:11 +00:00
volumes:
- ./scripts/database/initialize.sql:/docker-entrypoint-initdb.d/initialize.sql
- 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:
# Production
# image: amruthpillai/reactive-resume:server-latest
# Development
build:
context: .
dockerfile: server/Dockerfile
container_name: server
env_file: .env
environment:
- PUBLIC_URL=http://localhost
- POSTGRES_HOST=postgres
depends_on:
- traefik
- postgres
labels:
- traefik.enable=true
- traefik.http.routers.server.entrypoints=web
- traefik.http.routers.server.rule=Host(`localhost`) && 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:
# Production
# image: amruthpillai/reactive-resume:client-latest
# Development
build:
context: .
dockerfile: client/Dockerfile
container_name: client
env_file: .env
environment:
- PUBLIC_SERVER_URL=http://localhost/api
depends_on:
- traefik
- server
labels:
- traefik.enable=true
- traefik.http.routers.client.rule=Host(`localhost`)
- traefik.http.routers.client.entrypoints=web
volumes:
pgdata: