-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a737cc0
commit bc772f6
Showing
1 changed file
with
19 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,28 @@ | ||
FROM node:lts | ||
|
||
FROM node:lts-alpine AS base | ||
WORKDIR /app | ||
|
||
COPY ./package.json ./package.json | ||
RUN npm install | ||
|
||
# Install production dependencies | ||
FROM base AS install | ||
|
||
RUN npm install --omit=dev | ||
|
||
# Build project | ||
FROM install AS build | ||
|
||
ENV SKIP_ENV_VALIDATION=true | ||
|
||
RUN npm install | ||
|
||
COPY . . | ||
RUN npm run build | ||
|
||
CMD ["npm", "run", "start"] | ||
# Compose release container | ||
FROM base AS release | ||
|
||
COPY --from=install /app/node_modules ./node_modules | ||
COPY --from=build /app/.next ./.next | ||
|
||
EXPOSE 3000 | ||
CMD ["npm", "run", "start"] |