Add root docker-compose and webapp Dockerfile/nginx for full-stack deployment
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
47
docker-compose.yml
Normal file
47
docker-compose.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
environment:
|
||||
POSTGRES_USER: ralph
|
||||
POSTGRES_PASSWORD: ralph
|
||||
POSTGRES_DB: ralph
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ralph"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
migrate:
|
||||
build: ./backend
|
||||
command: ["/migrate"]
|
||||
environment:
|
||||
DATABASE_URL: postgres://ralph:ralph@postgres:5432/ralph?sslmode=disable
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
restart: on-failure
|
||||
|
||||
api:
|
||||
build: ./backend
|
||||
ports:
|
||||
- "8080:8080"
|
||||
environment:
|
||||
DATABASE_URL: postgres://ralph:ralph@postgres:5432/ralph?sslmode=disable
|
||||
LISTEN_ADDR: :8080
|
||||
depends_on:
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
restart: unless-stopped
|
||||
|
||||
webapp:
|
||||
build: ./webapp
|
||||
ports:
|
||||
- "9050:80"
|
||||
depends_on:
|
||||
- api
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
Reference in New Issue
Block a user