mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-14 22:08:45 +00:00
Production 환경에서의 DB 자동 Migration 구현
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -2,6 +2,10 @@
|
||||
FROM node:22-alpine AS base
|
||||
WORKDIR /app
|
||||
|
||||
RUN apk add --no-cache bash curl && \
|
||||
curl -o /usr/local/bin/wait-for-it https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh && \
|
||||
chmod +x /usr/local/bin/wait-for-it
|
||||
|
||||
RUN npm install -g pnpm@9
|
||||
COPY pnpm-lock.yaml .
|
||||
|
||||
@@ -10,10 +14,9 @@ FROM base AS build
|
||||
RUN pnpm fetch
|
||||
|
||||
COPY . .
|
||||
RUN pnpm install --offline
|
||||
RUN pnpm build
|
||||
|
||||
RUN sed -i "s/http\.createServer()/http.createServer({ requestTimeout: 0 })/g" ./build/index.js
|
||||
RUN pnpm install --offline && \
|
||||
pnpm build && \
|
||||
sed -i "s/http\.createServer()/http.createServer({ requestTimeout: 0 })/g" ./build/index.js
|
||||
|
||||
# Deploy Stage
|
||||
FROM base
|
||||
@@ -23,9 +26,7 @@ COPY package.json .
|
||||
RUN pnpm install --offline --prod
|
||||
|
||||
COPY --from=build /app/build ./build
|
||||
COPY drizzle ./drizzle
|
||||
|
||||
EXPOSE 3000
|
||||
ENV BODY_SIZE_LIMIT=Infinity
|
||||
|
||||
CMD ["node", "./build/index.js"]
|
||||
CMD ["bash", "-c", "wait-for-it ${DATABASE_HOST:-localhost}:${DATABASE_PORT:-5432} -- node ./build/index.js"]
|
||||
|
||||
Reference in New Issue
Block a user