Reactive-Resume/docker-compose.yml

88 lines
2.4 KiB
YAML
Raw Normal View History

2022-03-02 16:44:11 +00:00
version: '3'
services:
postgres:
image: postgres:14.2-alpine
container_name: postgres
2022-03-02 16:44:11 +00:00
ports:
- 5432:5432
environment:
- POSTGRES_USER="postgres"
- POSTGRES_PASSWORD="postgres"
- POSTGRES_DATABASE="postgres"
2022-03-02 16:44:11 +00:00
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres" ]
interval: 30s
timeout: 30s
start_period: 15s
retries: 3
restart: always
traefik:
image: traefik:rocamadour
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
environment:
- TZ="UTC"
- SECRET_KEY=""
- PUBLIC_URL="http://<SERVER-IP>"
- POSTGRES_HOST="postgres"
- POSTGRES_PORT="5432"
- POSTGRES_USERNAME="postgres"
- POSTGRES_PASSWORD="postgres"
- POSTGRES_DATABASE="postgres"
- POSTGRES_SSL_CERT=""
- JWT_SECRET=""
- JWT_EXPIRY_TIME="604800"
- PUBLIC_GOOGLE_CLIENT_ID=""
- GOOGLE_CLIENT_SECRET=""
- GOOGLE_API_KEY=""
- SENDGRID_API_KEY="" # Optional
- SENDGRID_FORGOT_PASSWORD_TEMPLATE_ID="" # Optional
- SENDGRID_FROM_NAME="" # Optional
- SENDGRID_FROM_EMAIL="" # Optional
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
restart: always
client:
image: amruthpillai/reactive-resume:client-latest
container_name: client
environment:
- TZ="UTC"
- PUBLIC_URL="http://<SERVER-IP>"
- PUBLIC_SERVER_URL="http://<SERVER-IP>/api"
- PUBLIC_GOOGLE_CLIENT_ID=""
depends_on:
- traefik
- server
labels:
- traefik.enable=true
- traefik.http.routers.client.rule=Host(`<SERVER-IP>`)
- traefik.http.routers.client.entrypoints=web
restart: always
volumes:
pgdata: