first commit. added CI, Docker compose, blank client and server. used unit tests, they pass
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
# Copy to .env and adjust.
|
||||
|
||||
MESSENGER_ENV=production
|
||||
MESSENGER_ALLOWED_ORIGINS=https://msg.example.com
|
||||
|
||||
POSTGRES_USER=messenger
|
||||
POSTGRES_PASSWORD=change-me
|
||||
POSTGRES_DB=messenger
|
||||
@@ -0,0 +1,36 @@
|
||||
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:
|
||||
Reference in New Issue
Block a user