36 lines
922 B
YAML
36 lines
922 B
YAML
services:
|
|||
|
|
api:
|
||
|
|
build:
|
||
|
|
context: .
|
||
|
|
dockerfile: Dockerfile
|
||
|
|
image: messenger/api:latest
|
||
|
|
restart: unless-stopped
|
||
|
|
environment:
|
||
|
|
MESSENGER_ENV: ${MESSENGER_ENV:-production}
|
||
|
|
MESSENGER_HTTP_ADDR: ":8080"
|
||
|
|
MESSENGER_ALLOWED_ORIGINS: ${MESSENGER_ALLOWED_ORIGINS:-}
|
||
|
|
ports:
|
||
|
|
- "8080:8080"
|
||
|
|
depends_on:
|
||
|
|
postgres:
|
||
|
|
condition: service_healthy
|
||
|
|
|
||
|
|
postgres:
|
||
|
|
image: postgres:17-alpine
|
||
|
|
restart: unless-stopped
|
||
|
|
environment:
|
||
|
|
POSTGRES_USER: ${POSTGRES_USER:-messenger}
|
||
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-messenger}
|
||
|
|
POSTGRES_DB: ${POSTGRES_DB:-messenger}
|
||
|
|
volumes:
|
||
|
|
- pgdata:/var/lib/postgresql/data
|
||
|
|
ports:
|
||
|
|
- "127.0.0.1:5432:5432"
|
||
|
|
healthcheck:
|
||
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-messenger} -d ${POSTGRES_DB:-messenger}"]
|
||
|
|
interval: 5s
|
||
|
|
timeout: 3s
|
||
|
|
retries: 10
|
||
|
|
|
||
|
|
volumes:
|
||
|
|
pgdata:
|