surl/compose.yaml

73 lines
1.6 KiB
YAML
Raw Normal View History

2024-08-12 19:55:59 +08:00
#version: '3.9'
2024-08-13 14:52:01 +08:00
name: surl
2024-07-23 17:54:15 +08:00
networks:
surl-network:
2024-08-12 14:49:56 +08:00
external: false
2024-07-23 17:54:15 +08:00
services:
2024-08-15 10:51:39 +08:00
backend:
container_name: surl_backend
2024-08-13 14:52:01 +08:00
build: .
2024-08-12 21:28:05 +08:00
restart: unless-stopped
2024-08-12 19:55:59 +08:00
depends_on:
2024-08-15 10:51:39 +08:00
redis:
2024-08-14 16:16:26 +08:00
condition: service_healthy
2024-08-15 10:51:39 +08:00
postgres:
2024-08-13 14:52:01 +08:00
condition: service_healthy
2024-07-23 17:54:15 +08:00
ports:
- ${PORT_BINDING}
2024-07-23 17:54:15 +08:00
networks:
- surl-network
environment:
PROTOCOL: ${PROTOCOL}
HOST: ${HOST}
PORT: ${PORT}
DB_HOST: surl_postgres
2024-07-23 17:54:15 +08:00
DB_PORT: 5432
2024-08-06 10:08:14 +08:00
# 更改此处密码
DB_PASS: ${DB_PASS}
REDIS_HOST: surl_redis
2024-08-06 10:08:14 +08:00
# change this to your secret key or it will be generated
#SECRET_KEY: ne09xhakcvoi13$>":<[].
2024-08-14 14:42:43 +08:00
healthcheck:
test: ["CMD", "java", "-version"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
2024-08-15 10:51:39 +08:00
redis:
container_name: surl_redis
2024-07-23 17:54:15 +08:00
image: redis:latest
2024-08-13 14:52:01 +08:00
restart: unless-stopped
2024-07-23 17:54:15 +08:00
networks:
- surl-network
2024-08-12 14:49:56 +08:00
volumes:
2024-08-15 10:51:39 +08:00
- redis_data:/data
2024-08-14 14:42:43 +08:00
healthcheck:
test: ["CMD", "redis-cli", "ping"]
2024-08-14 16:18:24 +08:00
interval: 5s
2024-08-14 14:42:43 +08:00
timeout: 5s
retries: 5
2024-08-14 16:17:12 +08:00
start_period: 5s
2024-08-15 10:51:39 +08:00
postgres:
container_name: surl_postgres
2024-07-23 17:54:15 +08:00
image: postgres:latest
2024-08-13 14:52:01 +08:00
restart: unless-stopped
2024-07-23 17:54:15 +08:00
networks:
- surl-network
2024-07-24 09:34:33 +08:00
environment:
2024-08-06 10:08:14 +08:00
# 更改此处密码
POSTGRES_PASSWORD: ${DB_PASS}
2024-08-12 14:49:56 +08:00
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
2024-08-15 10:51:39 +08:00
- postgres_data:/var/lib/postgresql/data
2024-08-13 14:52:01 +08:00
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
retries: 5
start_period: 5s
timeout: 5s
2024-08-12 14:49:56 +08:00
volumes:
redis_data:
name: surl_redis_data
postgres_data:
name: surl_postgres_data