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-09-04 08:55:18 +08:00
|
|
|
name: 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:
|
2024-08-21 08:59:38 +08:00
|
|
|
container_name: surl_backend
|
2024-08-13 14:52:01 +08:00
|
|
|
build: .
|
2024-08-26 09:29:54 +08:00
|
|
|
restart: on-failure:2
|
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:
|
2024-08-21 09:09:44 +08:00
|
|
|
- ${PORT_BINDING}
|
2024-07-23 17:54:15 +08:00
|
|
|
networks:
|
|
|
|
- surl-network
|
|
|
|
environment:
|
2024-08-21 09:09:44 +08:00
|
|
|
PROTOCOL: ${PROTOCOL}
|
|
|
|
HOST: ${HOST}
|
|
|
|
PORT: ${PORT}
|
2024-08-21 08:59:38 +08:00
|
|
|
DB_HOST: surl_postgres
|
2024-07-23 17:54:15 +08:00
|
|
|
DB_PORT: 5432
|
2024-08-06 10:08:14 +08:00
|
|
|
# 更改此处密码
|
2024-08-21 09:09:44 +08:00
|
|
|
DB_PASS: ${DB_PASS}
|
2024-08-21 08:59:38 +08:00
|
|
|
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-26 09:29:54 +08:00
|
|
|
volumes:
|
|
|
|
- ./build/libs:/opt/pak/surl
|
2024-08-15 10:51:39 +08:00
|
|
|
redis:
|
2024-08-21 08:59:38 +08:00
|
|
|
container_name: surl_redis
|
2024-07-23 17:54:15 +08:00
|
|
|
image: redis:latest
|
2024-08-26 09:29:54 +08:00
|
|
|
restart: on-failure:2
|
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:
|
2024-08-21 08:59:38 +08:00
|
|
|
container_name: surl_postgres
|
2024-07-23 17:54:15 +08:00
|
|
|
image: postgres:latest
|
2024-08-26 09:29:54 +08:00
|
|
|
restart: on-failure:2
|
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
|
|
|
# 更改此处密码
|
2024-08-21 09:09:44 +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:
|
2024-08-21 08:59:38 +08:00
|
|
|
redis_data:
|
|
|
|
name: surl_redis_data
|
|
|
|
postgres_data:
|
|
|
|
name: surl_postgres_data
|