feat(global): initialize project and framework structure, dockerize
This commit is contained in:
52
docker-compose.yml
Normal file
52
docker-compose.yml
Normal file
@@ -0,0 +1,52 @@
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:latest
|
||||
environment:
|
||||
POSTGRES_DB: ${DATABASE_NAME}
|
||||
POSTGRES_USER: ${DATABASE_USER}
|
||||
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
|
||||
PGDATA: "/var/lib/postgresql/data/pgdata"
|
||||
volumes:
|
||||
- database:/var/lib/postgresql/data
|
||||
profiles:
|
||||
- ${DATABASE_PROFILE}
|
||||
ports:
|
||||
- ${DATABASE_OPEN_PORT}:5432
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
database:
|
||||
aliases:
|
||||
- "postgres"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${DATABASE_USER}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 10s
|
||||
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: the-system/base
|
||||
env_file:
|
||||
- ".env"
|
||||
networks:
|
||||
database:
|
||||
profiles:
|
||||
- ${APPLICATION_PROFILE}
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 10s
|
||||
|
||||
volumes:
|
||||
database:
|
||||
|
||||
networks:
|
||||
database:
|
||||
Reference in New Issue
Block a user