chore: track deployment and expose frontend on LAN interfaces
This commit is contained in:
commit
db0f995997
7 files changed
+148
No files matched your search
@@ -0,0 +1,51 @@
|
||||
name: cg-grade
|
||||
services:
|
||||
db:
|
||||
image: mysql:8.0
|
||||
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
|
||||
environment:
|
||||
MYSQL_DATABASE: grading
|
||||
MYSQL_USER: grading
|
||||
MYSQL_PASSWORD: ${MYSQL_PASSWORD:?Use --env-file .env.local}
|
||||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:?Use --env-file .env.local}
|
||||
volumes:
|
||||
- mysql-data:/var/lib/mysql
|
||||
healthcheck:
|
||||
test: [CMD-SHELL, 'MYSQL_PWD="$$MYSQL_PASSWORD" mysql -h 127.0.0.1 -u grading grading -e "SELECT 1"']
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 30
|
||||
restart: unless-stopped
|
||||
api:
|
||||
build:
|
||||
context: ./hackathon-grading-system
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
PORT: 3080
|
||||
DB_HOST: db
|
||||
DB_NAME: grading
|
||||
DB_USER: grading
|
||||
DB_PWD: ${MYSQL_PASSWORD}
|
||||
JWT_KEY: ${JWT_KEY:?Use --env-file .env.local}
|
||||
WEB_SERVICE: cg-grade-local
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: [CMD, node, -e, "require('http').get('http://127.0.0.1:3080/system/appdata',r=>process.exit(r.statusCode===200?0:1)).on('error',()=>process.exit(1))"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
restart: unless-stopped
|
||||
web:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: deployment/frontend.Dockerfile
|
||||
ports:
|
||||
- "0.0.0.0:3081:80"
|
||||
depends_on:
|
||||
api:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
mysql-data:
|
||||
Reference in new issue
Block a user