implement gitlab blue-green ci cd
This commit is contained in:
1 parent
a353b80a15
commit
0f2dee08cb
13 files changed
+686
-230
No files matched your search
+42
-37
@@ -1,45 +1,50 @@
|
||||
name: warehouse-allocation
|
||||
|
||||
x-api-common: &api-common
|
||||
environment:
|
||||
WA_ENVIRONMENT: production
|
||||
WA_INVENTORY_BACKEND: redis
|
||||
WA_REDIS_URL: redis://redis:6379/0
|
||||
WA_REDIS_SOCKET_TIMEOUT_SECONDS: "0.08"
|
||||
WA_MAX_CANDIDATE_WAREHOUSES: "33"
|
||||
WA_INVENTORY_ADMIN_TOKEN: ${WA_INVENTORY_ADMIN_TOKEN:?inventory admin token is required}
|
||||
restart: unless-stopped
|
||||
read_only: true
|
||||
tmpfs:
|
||||
- /tmp:size=32m,mode=1777
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
mem_limit: 384m
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD
|
||||
- python
|
||||
- -c
|
||||
- "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/health/ready', timeout=1)"
|
||||
interval: 5s
|
||||
timeout: 2s
|
||||
retries: 10
|
||||
start_period: 10s
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: 10m
|
||||
max-file: "3"
|
||||
|
||||
services:
|
||||
api:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: Dockerfile
|
||||
image: local/warehouse-allocation:${APP_VERSION:-latest}
|
||||
environment:
|
||||
WA_ENVIRONMENT: production
|
||||
WA_INVENTORY_BACKEND: redis
|
||||
WA_REDIS_URL: redis://redis:6379/0
|
||||
WA_REDIS_SOCKET_TIMEOUT_SECONDS: "0.08"
|
||||
WA_MAX_CANDIDATE_WAREHOUSES: "33"
|
||||
WA_INVENTORY_ADMIN_TOKEN: ${WA_INVENTORY_ADMIN_TOKEN:?inventory admin token is required}
|
||||
api-blue:
|
||||
<<: *api-common
|
||||
image: ${BLUE_IMAGE:?blue image is required}
|
||||
profiles: [blue]
|
||||
ports:
|
||||
- "127.0.0.1:18081:8080"
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
read_only: true
|
||||
tmpfs:
|
||||
- /tmp:size=32m,mode=1777
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
mem_limit: 512m
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD
|
||||
- python
|
||||
- -c
|
||||
- "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/health/ready', timeout=1)"
|
||||
interval: 10s
|
||||
timeout: 2s
|
||||
retries: 5
|
||||
start_period: 10s
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: 10m
|
||||
max-file: "3"
|
||||
|
||||
api-green:
|
||||
<<: *api-common
|
||||
image: ${GREEN_IMAGE:?green image is required}
|
||||
profiles: [green]
|
||||
ports:
|
||||
- "127.0.0.1:18082:8080"
|
||||
|
||||
redis:
|
||||
image: redis:7.4-alpine
|
||||
|
||||
Reference in new issue
Block a user