Skip to content

Commit

Permalink
Improve docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorsharp committed Jan 4, 2025
1 parent a737cc0 commit bc772f6
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions Dockerfile
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"]

0 comments on commit bc772f6

Please sign in to comment.