feat: v2 rewrite — hexagonal arch, ActivityPub federation, NATS, deployment-ready (#1)
This commit was merged in pull request #1.
This commit is contained in:
122
compose.yml
122
compose.yml
@@ -1,77 +1,67 @@
|
||||
services:
|
||||
database:
|
||||
image: postgres:15-alpine
|
||||
container_name: thoughts-db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "5433:5432"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
backend:
|
||||
container_name: thoughts-backend
|
||||
build:
|
||||
context: ./thoughts-backend
|
||||
dockerfile: Dockerfile
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- RUST_LOG=info
|
||||
- RUST_BACKTRACE=1
|
||||
depends_on:
|
||||
database:
|
||||
condition: service_healthy
|
||||
|
||||
frontend:
|
||||
container_name: thoughts-frontend
|
||||
build:
|
||||
context: ./thoughts-frontend
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
NEXT_PUBLIC_API_URL: http://localhost/api
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- backend
|
||||
environment:
|
||||
- NEXT_PUBLIC_SERVER_SIDE_API_URL=http://proxy/api
|
||||
|
||||
proxy:
|
||||
container_name: thoughts-proxy
|
||||
image: nginx:stable-alpine
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "80:80"
|
||||
volumes:
|
||||
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
|
||||
depends_on:
|
||||
- frontend
|
||||
- backend
|
||||
|
||||
db_test:
|
||||
image: postgres:15-alpine
|
||||
container_name: thoughts-db-test
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
environment:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: postgres
|
||||
POSTGRES_DB: thoughts
|
||||
ports:
|
||||
- "5434:5432"
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
|
||||
interval: 10s
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
nats:
|
||||
image: nats:2-alpine
|
||||
ports:
|
||||
- "4222:4222"
|
||||
- "8222:8222" # monitoring endpoint
|
||||
command: ["--jetstream", "--http_port", "8222"]
|
||||
|
||||
api:
|
||||
build: .
|
||||
ports:
|
||||
- "8000:8000"
|
||||
environment:
|
||||
DATABASE_URL: postgres://postgres:postgres@postgres:5432/thoughts
|
||||
JWT_SECRET: change-me-in-production
|
||||
BASE_URL: http://localhost:8000
|
||||
NATS_URL: nats://nats:4222
|
||||
RUST_LOG: info
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
nats:
|
||||
condition: service_started
|
||||
|
||||
worker:
|
||||
build: .
|
||||
entrypoint: ["./thoughts-worker"]
|
||||
environment:
|
||||
DATABASE_URL: postgres://postgres:postgres@postgres:5432/thoughts
|
||||
BASE_URL: http://localhost:8000
|
||||
NATS_URL: nats://nats:4222
|
||||
RUST_LOG: info
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
nats:
|
||||
condition: service_started
|
||||
|
||||
frontend:
|
||||
build:
|
||||
context: ./thoughts-frontend
|
||||
args:
|
||||
NEXT_PUBLIC_API_URL: http://localhost:8000
|
||||
NEXT_PUBLIC_SERVER_SIDE_API_URL: http://api:8000
|
||||
ports:
|
||||
- "3000:3000"
|
||||
depends_on:
|
||||
- api
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
driver: local
|
||||
|
||||
Reference in New Issue
Block a user