53 lines
950 B
YAML
53 lines
950 B
YAML
version: '3.8'
|
|
|
|
services:
|
|
db:
|
|
image: postgres:13
|
|
container_name: db-c
|
|
environment:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_DB: mydb
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./database/backups:/backups
|
|
restart: always
|
|
networks:
|
|
- custom-network
|
|
|
|
api:
|
|
build: ./api
|
|
container_name: api-c
|
|
environment:
|
|
- PGHOST=db
|
|
- PGUSER=postgres
|
|
- PGPASSWORD=postgres
|
|
- PGDATABASE=mydb
|
|
- PGPORT=5432
|
|
ports:
|
|
- "3000:3000"
|
|
depends_on:
|
|
- db
|
|
networks:
|
|
- custom-network
|
|
|
|
|
|
frontend:
|
|
build: ./frontend
|
|
container_name: front-c
|
|
ports:
|
|
- "80:80"
|
|
depends_on:
|
|
- api
|
|
networks:
|
|
- custom-network
|
|
|
|
networks:
|
|
custom-network:
|
|
driver: bridge
|
|
volumes:
|
|
postgres_data:
|