diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml new file mode 100644 index 0000000..e70aa17 --- /dev/null +++ b/docker-compose.prod.yml @@ -0,0 +1,38 @@ +name: ${COMPOSE_PROJECT_NAME:-zhixing-system} + +services: + server: + build: + context: ./zhixing-server + target: production + restart: unless-stopped + environment: + ZHIXING_APP_ENV: production + ZHIXING_LOG_LEVEL: ${ZHIXING_LOG_LEVEL:-INFO} + init: true + expose: + - "8000" + healthcheck: + test: + - CMD + - python + - -c + - "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/healthz')" + interval: 30s + timeout: 5s + retries: 3 + start_period: 10s + + web: + build: + context: ./zhixing-web + target: production + restart: unless-stopped + depends_on: + server: + condition: service_healthy + environment: + API_UPSTREAM: http://server:8000 + init: true + ports: + - "${ZHIXING_WEB_PORT:-8111}:80"