-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1664 from ever-co/develop
Release
- Loading branch information
Showing
22 changed files
with
1,250 additions
and
390 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
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
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# syntax = docker/dockerfile:1 | ||
|
||
# Adjust NODE_VERSION as desired | ||
ARG NODE_VERSION=18.17.1 | ||
FROM node:${NODE_VERSION}-slim as base | ||
|
||
|
||
# Next.js app lives here | ||
WORKDIR /app | ||
|
||
# Set production environment | ||
ENV NEXT_SHARP_PATH=/app/node_modules/sharp | ||
|
||
|
||
# Throw-away build stage to reduce size of final image | ||
FROM base as build | ||
|
||
# Install packages needed to build node modules | ||
RUN apt-get update -qq && \ | ||
apt-get install -y build-essential pkg-config python-is-python3 | ||
|
||
# Install Yarn | ||
RUN npm install -g yarn --force | ||
|
||
# Install node modules | ||
COPY --link package.json ./ | ||
COPY --link yarn.lock ./ | ||
COPY --link apps/web/package.json ./apps/web/package.json | ||
|
||
RUN cd apps/web && \ | ||
yarn install --ignore-scripts | ||
|
||
# Copy application code | ||
COPY --link . . | ||
|
||
ENV NODE_ENV="production" | ||
|
||
# Build application | ||
RUN yarn run build:web | ||
|
||
# Remove development dependencies | ||
RUN cd apps/web && \ | ||
yarn install --prod --ignore-scripts | ||
|
||
|
||
# Final stage for app image | ||
FROM base | ||
|
||
ENV NODE_ENV="production" | ||
|
||
# Copy built application | ||
COPY --from=build /app /app | ||
|
||
# Start the server by default, this can be overwritten at runtime | ||
EXPOSE 3000 | ||
|
||
CMD [ "npm", "run", "start:web" ] |
Oops, something went wrong.