recipe_app/docker-compose.yaml

46 lines
1 KiB
YAML
Raw Normal View History

2025-07-15 12:02:11 -07:00
services:
db:
2025-08-05 18:11:03 +00:00
container_name: recipes_postgres_${ID}
2025-07-15 12:02:11 -07:00
image: docker.io/library/postgres:17
2025-07-17 09:17:10 -07:00
# restart: always
2025-07-15 12:02:11 -07:00
env_file:
- .env
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_NAME}
ports:
2025-07-25 18:07:20 +00:00
- "${DB_PORT}:5432"
2025-07-15 12:02:11 -07:00
volumes:
- ./postgres/db:/var/lib/postgresql/data
backend:
image: recipes_backend
2025-08-05 18:11:03 +00:00
container_name: recipes_backend_${ID}
2025-07-25 16:00:55 -07:00
build:
context: ./backend
args:
NODE_ENV: ${NODE_ENV}
2025-07-15 12:02:11 -07:00
ports:
2025-08-05 18:11:03 +00:00
- "${BACKEND_PORT}:3000"
2025-07-15 12:02:11 -07:00
volumes:
- ./backend:/usr/src/app
2025-08-14 15:12:28 -07:00
- ./logs:/logs
2025-07-15 12:02:11 -07:00
environment:
2025-07-25 16:00:55 -07:00
- NODE_ENV=${NODE_ENV}
2025-07-15 12:02:11 -07:00
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_NAME=${DB_NAME}
frontend:
image: recipes_frontend
2025-08-05 18:11:03 +00:00
container_name: recipes_frontend_${ID}
2025-07-25 16:00:55 -07:00
build:
context: ./backend
args:
NODE_ENV: ${NODE_ENV}
2025-07-15 12:02:11 -07:00
ports:
2025-08-05 18:11:03 +00:00
- "${FRONTEND_PORT}:80"
2025-07-15 12:02:11 -07:00
volumes:
- ./frontend:/usr/src/app
environment:
2025-07-25 16:00:55 -07:00
- NODE_ENV=${NODE_ENV}