Use docker compose
This commit is contained in:
39
docker-compose.yml
Normal file
39
docker-compose.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
backend:
|
||||
build:
|
||||
context: ./backend
|
||||
image: cafeteria-backend:${BACKEND_TAG}
|
||||
container_name: cafeteria-backend
|
||||
ports:
|
||||
- "8000:8000"
|
||||
environment:
|
||||
- JENKINS_BASE_URL: ${JENKINS_BASE_URL}
|
||||
- JENKINS_JOB_NAME: ${JENKINS_JOB_NAME}
|
||||
- JENKINS_USER: ${JENKINS_USER}
|
||||
- JENKINS_TOKEN: ${JENKINS_TOKEN}
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test:
|
||||
[
|
||||
"CMD",
|
||||
"python",
|
||||
"-c",
|
||||
"import urllib.request; urllib.request.urlopen('http://localhost:8000/health').read()"
|
||||
]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 5
|
||||
|
||||
frontend:
|
||||
build:
|
||||
context: ./frontend
|
||||
image: cafeteria-frontend:${fRONTEND_TAG}
|
||||
container_name: cafeteria-frontend
|
||||
ports:
|
||||
- "80:80"
|
||||
depends_on:
|
||||
backend:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
Reference in New Issue
Block a user