mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-19 11:12:00 +10:00
fix(docker): fix docker-compose for production grade deployments
This commit is contained in:
64
docker-compose.dev.yml
Normal file
64
docker-compose.dev.yml
Normal file
@ -0,0 +1,64 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres
|
||||
container_name: postgres
|
||||
ports:
|
||||
- 5432:5432
|
||||
env_file: .env
|
||||
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:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: server/Dockerfile
|
||||
container_name: server
|
||||
env_file: .env
|
||||
environment:
|
||||
- PUBLIC_URL=http://localhost
|
||||
- POSTGRES_HOST=postgres
|
||||
- POSTGRES_DATABASE=reactive_resume
|
||||
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:
|
||||
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:
|
||||
Reference in New Issue
Block a user