minor
This commit is contained in:
98
docker-compose.yml
Normal file
98
docker-compose.yml
Normal file
@@ -0,0 +1,98 @@
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
db:
|
||||
build:
|
||||
context: ./db
|
||||
dockerfile: Dockerfile
|
||||
image: my-postgres-with-schema:16
|
||||
container_name: my_postgres
|
||||
restart: unless-stopped
|
||||
|
||||
environment:
|
||||
POSTGRES_USER: building_catalog
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: building_catalog
|
||||
TZ: Europe/Moscow
|
||||
|
||||
expose:
|
||||
- "5432"
|
||||
|
||||
network_mode: bridge
|
||||
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -h 127.0.0.1 -p 5432 -U building_catalog -d building_catalog"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 10s
|
||||
|
||||
server:
|
||||
build:
|
||||
context: ./server
|
||||
dockerfile: Dockerfile
|
||||
container_name: building_catalog_server
|
||||
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
|
||||
links:
|
||||
- "db:db"
|
||||
|
||||
environment:
|
||||
PGHOST: db
|
||||
PGPORT: 5432
|
||||
PGDATABASE: building_catalog
|
||||
PGUSER: building_catalog
|
||||
PGPASSWORD: postgres
|
||||
|
||||
JWT_SECRET: dev-secret
|
||||
ADMIN_EMAIL: admin@shop.local
|
||||
ADMIN_PASSWORD: secret
|
||||
PORT: 8080
|
||||
|
||||
ports:
|
||||
- "8080:8080"
|
||||
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "grep -q ':1F90 ' /proc/net/tcp /proc/net/tcp6"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 12
|
||||
start_period: 15s
|
||||
|
||||
network_mode: bridge
|
||||
|
||||
dashboard:
|
||||
build:
|
||||
context: ./dashboard
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
API_BASE_URL: http://localhost:8080/api/v1
|
||||
container_name: building_catalog_dashboard
|
||||
|
||||
depends_on:
|
||||
server:
|
||||
condition: service_healthy
|
||||
|
||||
links:
|
||||
- "server:server"
|
||||
|
||||
ports:
|
||||
- "8082:80"
|
||||
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "wget -q -O /dev/null http://127.0.0.1/ || exit 1"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 12
|
||||
start_period: 10s
|
||||
|
||||
network_mode: bridge
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
Reference in New Issue
Block a user