mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 20:35:02 +00:00
Early work on prod container
This commit is contained in:
parent
17fa857609
commit
91f54424ed
8 changed files with 132 additions and 9 deletions
63
docker-compose.production.yml
Normal file
63
docker-compose.production.yml
Normal file
|
@ -0,0 +1,63 @@
|
|||
version: '3'
|
||||
name: zeppelin-prod
|
||||
volumes:
|
||||
mysql-data: {}
|
||||
services:
|
||||
nginx:
|
||||
build:
|
||||
context: ./docker/production/nginx
|
||||
args:
|
||||
API_PORT: ${API_PORT:?Missing API_PORT}
|
||||
DOCKER_PROD_DOMAIN: ${DOCKER_PROD_DOMAIN:?Missing DOCKER_PROD_DOMAIN}
|
||||
ports:
|
||||
- "${DOCKER_PROD_WEB_PORT:?Missing DOCKER_PROD_WEB_PORT}:443"
|
||||
volumes:
|
||||
- ./:/zeppelin
|
||||
|
||||
mysql:
|
||||
image: mysql:8.0
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: ${DOCKER_PROD_MYSQL_ROOT_PASSWORD?:Missing DOCKER_PROD_MYSQL_ROOT_PASSWORD}
|
||||
MYSQL_DATABASE: zeppelin
|
||||
MYSQL_USER: zeppelin
|
||||
MYSQL_PASSWORD: ${DOCKER_PROD_MYSQL_PASSWORD?:Missing DOCKER_PROD_MYSQL_PASSWORD}
|
||||
ports:
|
||||
- ${DOCKER_PROD_MYSQL_PORT:?Missing DOCKER_PROD_MYSQL_PORT}:3306
|
||||
volumes:
|
||||
- mysql-data:/var/lib/mysql
|
||||
command: --authentication-policy=mysql_native_password
|
||||
|
||||
prepare_backend:
|
||||
image: node:16.16
|
||||
depends_on:
|
||||
- mysql
|
||||
volumes:
|
||||
- ./:/zeppelin
|
||||
user: node
|
||||
command: |-
|
||||
bash -c "cd /zeppelin/backend && npm ci && npm run build && npm run migrate-prod"
|
||||
|
||||
api:
|
||||
image: node:16.16
|
||||
restart: on-failure
|
||||
depends_on:
|
||||
- prepare_backend
|
||||
volumes:
|
||||
- ./:/zeppelin
|
||||
|
||||
# Wait for the build_backend container to finish before starting the bot
|
||||
# See: https://github.com/docker/compose/issues/5007#issuecomment-335815508
|
||||
user: node
|
||||
command: |-
|
||||
bash -c ' \
|
||||
while ping -c1 prepare_backend &>/dev/null; do sleep 1; done; \
|
||||
cd /zeppelin/backend && npm run start-api-prod \
|
||||
'
|
||||
|
||||
build_dashboard:
|
||||
image: node:16.16
|
||||
volumes:
|
||||
- ./:/zeppelin
|
||||
user: node
|
||||
command: |-
|
||||
bash -c "cd /zeppelin/dashboard && npm ci && npm run build"
|
Loading…
Add table
Add a link
Reference in a new issue