mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-07-01 12:32:09 +00:00
Create Dockerfile
This commit is contained in:
parent
8e8c734065
commit
ac7bb05708
1 changed files with 30 additions and 0 deletions
30
new-frontend/Dockerfile
Normal file
30
new-frontend/Dockerfile
Normal file
|
@ -0,0 +1,30 @@
|
|||
# Stage 1: Build the Next.js application
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json yarn.lock ./
|
||||
RUN corepack enable
|
||||
RUN yarn install --frozen-lockfile --network-timeout 600000
|
||||
|
||||
COPY . .
|
||||
RUN yarn build
|
||||
|
||||
# Stage 2: Production environment
|
||||
FROM node:20-alpine AS runner
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
COPY --from=builder /app/.next ./.next
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/package.json ./package.json
|
||||
COPY --from=builder /app/yarn.lock ./yarn.lock
|
||||
|
||||
RUN corepack enable
|
||||
RUN yarn install --production --frozen-lockfile --network-timeout 600000
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["yarn", "start"]
|
Loading…
Reference in a new issue