update dockerfile and update docker compose yml

This commit is contained in:
xuliulei 2024-10-09 08:27:42 +08:00
parent cd2ac9e8df
commit 2d99451932
2 changed files with 16 additions and 8 deletions

View File

@ -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

View File

@ -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}