mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-23 05:01:49 +10:00
fix(docker): fix docker-compose for production grade deployments
This commit is contained in:
@ -8,7 +8,6 @@ services:
|
||||
- 5432:5432
|
||||
env_file: .env
|
||||
volumes:
|
||||
- ./scripts/database/initialize.sql:/docker-entrypoint-initdb.d/initialize.sql
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
|
||||
traefik:
|
||||
@ -24,17 +23,11 @@ services:
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
|
||||
server:
|
||||
# Production
|
||||
# image: amruthpillai/reactive-resume:server-latest
|
||||
|
||||
# Development
|
||||
build:
|
||||
context: .
|
||||
dockerfile: server/Dockerfile
|
||||
image: amruthpillai/reactive-resume:server-latest
|
||||
container_name: server
|
||||
env_file: .env
|
||||
environment:
|
||||
- PUBLIC_URL=http://localhost
|
||||
- PUBLIC_URL=http://<SERVER-IP>
|
||||
- POSTGRES_HOST=postgres
|
||||
depends_on:
|
||||
- traefik
|
||||
@ -42,29 +35,23 @@ services:
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.server.entrypoints=web
|
||||
- traefik.http.routers.server.rule=Host(`localhost`) && PathPrefix(`/api/`)
|
||||
- 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:
|
||||
# Production
|
||||
# image: amruthpillai/reactive-resume:client-latest
|
||||
|
||||
# Development
|
||||
build:
|
||||
context: .
|
||||
dockerfile: client/Dockerfile
|
||||
image: amruthpillai/reactive-resume:client-latest
|
||||
container_name: client
|
||||
env_file: .env
|
||||
environment:
|
||||
- PUBLIC_SERVER_URL=http://localhost/api
|
||||
- PUBLIC_SERVER_URL=http://<SERVER-IP>/api
|
||||
depends_on:
|
||||
- traefik
|
||||
- server
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.client.rule=Host(`localhost`)
|
||||
- traefik.http.routers.client.rule=Host(`<SERVER-IP>`)
|
||||
- traefik.http.routers.client.entrypoints=web
|
||||
|
||||
volumes:
|
||||
|
||||
Reference in New Issue
Block a user