From 2d99451932680c8bf839ae5ed39aa3b7cc6edc5c Mon Sep 17 00:00:00 2001 From: xuliulei Date: Wed, 9 Oct 2024 08:27:42 +0800 Subject: [PATCH] update dockerfile and update docker compose yml --- Dockerfile | 8 ++++++++ docker-compose.yml | 16 ++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2836dfb..7c80488 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,6 +35,14 @@ ENV SHADOW_DATABASE_URL=${SHADOW_DATABASE_URL} ENV NUXT_HOST=0.0.0.0 ENV NUXT_PORT=3000 +run echo ${ADMIN_USER} +run echo ${ADMIN_PASSWORD} +run echo ${ADMIN_EMAIL} +run echo ${JWT_SECRET} +run echo ${DATABASE_URL} +run echo ${DATABASE_SCHEMA} +run echo ${SHADOW_DATABASE_URL} + # RUN npm install RUN npx prisma generate RUN npx prisma migrate deploy diff --git a/docker-compose.yml b/docker-compose.yml index a961717..d0e1ede 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,15 +8,15 @@ services: build: context: . # 构建上下文,通常是 Dockerfile 所在的目录 dockerfile: Dockerfile # Dockerfile 的名称 + args: + ADMIN_USER: ${ADMIN_USER} + ADMIN_PASSWORD: ${ADMIN_PASSWORD} + ADMIN_EMAIL: ${ADMIN_EMAIL} + JWT_SECRET: ${JWT_SECRET} + DATABASE_URL: ${DATABASE_URL} + DATABASE_SCHEMA: ${DATABASE_SCHEMA} + SHADOW_DATABASE_URL: ${SHADOW_DATABASE_URL} ports: - "3000:3000" # 映射容器的 3000 端口到宿主机的 3000 端口 env_file: - .env - environment: # 定义环境变量 - - ADMIN_USER=${ADMIN_USER} - - ADMIN_PASSWORD=${ADMIN_PASSWORD} - - ADMIN_EMAIL=${ADMIN_EMAIL} - - JWT_SECRET=${JWT_SECRET} - - DATABASE_URL=${DATABASE_URL} - - DATABASE_SCHEMA=${DATABASE_SCHEMA} - - SHADOW_DATABASE_URL=${SHADOW_DATABASE_URL}