2025-07-10 01:27:35 +08:00
|
|
|
version: '3.8'
|
|
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
postgres:
|
|
|
|
|
image: postgres:15-alpine
|
|
|
|
|
environment:
|
2025-07-19 09:45:51 +08:00
|
|
|
POSTGRES_DB: url_db
|
2025-07-10 01:27:35 +08:00
|
|
|
POSTGRES_USER: postgres
|
|
|
|
|
POSTGRES_PASSWORD: password
|
|
|
|
|
ports:
|
2025-07-19 10:57:41 +08:00
|
|
|
- "5431:5432"
|
2025-07-10 01:27:35 +08:00
|
|
|
volumes:
|
|
|
|
|
- postgres_data:/var/lib/postgresql/data
|
|
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
|
|
|
interval: 10s
|
|
|
|
|
timeout: 5s
|
|
|
|
|
retries: 5
|
2025-07-19 11:53:37 +08:00
|
|
|
networks:
|
|
|
|
|
- app-network
|
2025-07-10 01:27:35 +08:00
|
|
|
|
2025-07-18 00:34:27 +08:00
|
|
|
backend:
|
2025-07-21 16:37:00 +08:00
|
|
|
image: ctwj/urldb-backend:1.0.7
|
2025-07-19 09:45:51 +08:00
|
|
|
expose:
|
|
|
|
|
- "8080"
|
2025-07-10 01:27:35 +08:00
|
|
|
environment:
|
|
|
|
|
DB_HOST: postgres
|
|
|
|
|
DB_PORT: 5432
|
|
|
|
|
DB_USER: postgres
|
|
|
|
|
DB_PASSWORD: password
|
2025-07-19 00:44:00 +08:00
|
|
|
DB_NAME: url_db
|
2025-07-10 01:27:35 +08:00
|
|
|
PORT: 8080
|
|
|
|
|
depends_on:
|
|
|
|
|
postgres:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
volumes:
|
|
|
|
|
- ./uploads:/root/uploads
|
2025-07-19 09:45:51 +08:00
|
|
|
networks:
|
|
|
|
|
- app-network
|
2025-07-10 01:27:35 +08:00
|
|
|
|
2025-07-18 00:34:27 +08:00
|
|
|
frontend:
|
2025-07-21 16:37:00 +08:00
|
|
|
image: ctwj/urldb-frontend:1.0.7
|
2025-07-18 00:34:27 +08:00
|
|
|
environment:
|
2025-07-21 15:27:58 +08:00
|
|
|
API_BASE: /api
|
2025-07-19 09:45:51 +08:00
|
|
|
depends_on:
|
|
|
|
|
- backend
|
|
|
|
|
networks:
|
|
|
|
|
- app-network
|
|
|
|
|
|
|
|
|
|
nginx:
|
|
|
|
|
image: nginx:alpine
|
|
|
|
|
ports:
|
2025-07-19 10:07:04 +08:00
|
|
|
- "3030:80"
|
2025-07-19 09:45:51 +08:00
|
|
|
volumes:
|
|
|
|
|
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
|
|
|
|
- ./nginx/conf.d:/etc/nginx/conf.d:ro
|
2025-07-18 00:34:27 +08:00
|
|
|
depends_on:
|
|
|
|
|
- backend
|
2025-07-19 09:45:51 +08:00
|
|
|
- frontend
|
|
|
|
|
networks:
|
|
|
|
|
- app-network
|
|
|
|
|
restart: unless-stopped
|
2025-07-18 00:34:27 +08:00
|
|
|
|
2025-07-10 01:27:35 +08:00
|
|
|
volumes:
|
2025-07-19 09:45:51 +08:00
|
|
|
postgres_data:
|
|
|
|
|
|
|
|
|
|
networks:
|
|
|
|
|
app-network:
|
|
|
|
|
driver: bridge
|