migrate
This commit is contained in:
37
Dockerfile
37
Dockerfile
@@ -41,43 +41,6 @@ COPY . .
|
||||
RUN npm run build
|
||||
|
||||
|
||||
# =========================================================
|
||||
# Migration / Seed image
|
||||
#
|
||||
# ใช้ target นี้สำหรับ:
|
||||
# - npm run migrate
|
||||
# - npm run seed:master-data
|
||||
# - npm run seed:super-admin
|
||||
# =========================================================
|
||||
FROM base AS migrator
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV HUSKY=0
|
||||
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY package.json ./
|
||||
|
||||
# Drizzle configuration
|
||||
COPY drizzle.config.* ./
|
||||
|
||||
# Migration files
|
||||
COPY drizzle ./drizzle
|
||||
|
||||
# Database source code ที่ migration/seed scripts อาจ import
|
||||
COPY src ./src
|
||||
COPY scripts ./scripts
|
||||
|
||||
# ถ้าโปรเจกต์ใช้ tsconfig path alias
|
||||
COPY tsconfig.json ./
|
||||
|
||||
# ถ้ามีไฟล์ config อื่นที่ scripts ใช้งาน ให้เปิดใช้ตามจริง
|
||||
# COPY next.config.* ./
|
||||
# COPY env.* ./
|
||||
|
||||
CMD ["npm", "run", "migrate"]
|
||||
|
||||
|
||||
# =========================================================
|
||||
# Production Runner
|
||||
# =========================================================
|
||||
|
||||
Reference in New Issue
Block a user