chore: update compose.prod.yml (worker+nats external), CI builds frontend, deprecate thoughts-backend
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Has been cancelled
test / unit (pull_request) Has been cancelled
test / integration (pull_request) Has been cancelled
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Has been cancelled
test / unit (pull_request) Has been cancelled
test / integration (pull_request) Has been cancelled
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
services:
|
||||
database:
|
||||
image: postgres:15-alpine
|
||||
image: postgres:16-alpine
|
||||
container_name: thoughts-db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
@@ -17,19 +17,21 @@ services:
|
||||
networks:
|
||||
- internal
|
||||
|
||||
backend:
|
||||
container_name: thoughts-backend
|
||||
image: thoughts-backend:latest
|
||||
api:
|
||||
container_name: thoughts-api
|
||||
image: registry.gabrielkaszewski.dev/thoughts:latest
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- RUST_LOG=info
|
||||
- RUST_BACKTRACE=1
|
||||
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database/${POSTGRES_DB}
|
||||
- HOST=0.0.0.0
|
||||
- PORT=8000
|
||||
- PREFORK=1
|
||||
- AUTH_SECRET=${AUTH_SECRET}
|
||||
- BASE_URL=https://thoughts.gabrielkaszewski.dev
|
||||
RUST_LOG: info
|
||||
RUST_ENV: production
|
||||
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database/${POSTGRES_DB}
|
||||
HOST: 0.0.0.0
|
||||
PORT: 8000
|
||||
JWT_SECRET: ${JWT_SECRET}
|
||||
BASE_URL: ${BASE_URL}
|
||||
NATS_URL: ${NATS_URL}
|
||||
CORS_ORIGINS: ${CORS_ORIGINS:-*}
|
||||
ALLOW_REGISTRATION: ${ALLOW_REGISTRATION:-false}
|
||||
depends_on:
|
||||
database:
|
||||
condition: service_healthy
|
||||
@@ -40,22 +42,41 @@ services:
|
||||
retries: 5
|
||||
networks:
|
||||
- internal
|
||||
- nats
|
||||
|
||||
worker:
|
||||
container_name: thoughts-worker
|
||||
image: registry.gabrielkaszewski.dev/thoughts:latest
|
||||
entrypoint: ["./thoughts-worker"]
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
RUST_LOG: info
|
||||
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database/${POSTGRES_DB}
|
||||
BASE_URL: ${BASE_URL}
|
||||
NATS_URL: ${NATS_URL}
|
||||
depends_on:
|
||||
database:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- internal
|
||||
- nats
|
||||
|
||||
frontend:
|
||||
container_name: thoughts-frontend
|
||||
image: thoughts-frontend:latest
|
||||
image: registry.gabrielkaszewski.dev/thoughts-frontend:latest
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
NEXT_PUBLIC_SERVER_SIDE_API_URL: http://api:8000
|
||||
PORT: 3000
|
||||
HOSTNAME: 0.0.0.0
|
||||
depends_on:
|
||||
- backend
|
||||
api:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:3000"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
environment:
|
||||
- NEXT_PUBLIC_SERVER_SIDE_API_URL=http://proxy/api
|
||||
- PORT=3000
|
||||
- HOSTNAME=0.0.0.0
|
||||
networks:
|
||||
- internal
|
||||
|
||||
@@ -66,7 +87,7 @@ services:
|
||||
depends_on:
|
||||
frontend:
|
||||
condition: service_healthy
|
||||
backend:
|
||||
api:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- internal
|
||||
@@ -83,7 +104,13 @@ services:
|
||||
volumes:
|
||||
postgres_data:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
# Shared NATS network — must already exist on the host (external: true).
|
||||
# Set NATS_NETWORK env var to match your shared network name (default: nats).
|
||||
nats:
|
||||
name: ${NATS_NETWORK:-nats}
|
||||
external: true
|
||||
traefik:
|
||||
name: traefik
|
||||
external: true
|
||||
|
||||
Reference in New Issue
Block a user