Files
oculog/docker-compose.yml
2026-02-12 14:52:37 -06:00

76 lines
1.6 KiB
YAML

version: '3.8'
services:
postgres:
image: postgres:15-alpine
container_name: oculog-postgres
environment:
- POSTGRES_DB=oculog
- POSTGRES_USER=oculog
- POSTGRES_PASSWORD=oculog_password
volumes:
- postgres_data:/var/lib/postgresql/data
- ./server/backend/db/init.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- "5432:5432"
restart: unless-stopped
networks:
- oculog-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U oculog"]
interval: 10s
timeout: 5s
retries: 5
backend:
build:
context: ./server/backend
dockerfile: Dockerfile
container_name: oculog-backend
ports:
- "3001:3001"
environment:
- NODE_ENV=development
- PORT=3001
- CORS_ORIGIN=http://localhost:3000
- DB_HOST=postgres
- DB_PORT=5432
- DB_NAME=oculog
- DB_USER=oculog
- DB_PASSWORD=oculog_password
volumes:
- ./server/backend:/app
- ./clients:/app/clients
- /app/node_modules
depends_on:
postgres:
condition: service_healthy
restart: unless-stopped
networks:
- oculog-network
frontend:
build:
context: ./server/frontend
dockerfile: Dockerfile
container_name: oculog-frontend
ports:
- "3000:3000"
environment:
- REACT_APP_API_URL=http://localhost:3001
volumes:
- ./server/frontend:/app
- /app/node_modules
depends_on:
- backend
restart: unless-stopped
networks:
- oculog-network
networks:
oculog-network:
driver: bridge
volumes:
postgres_data: