Skip to content

Instantly share code, notes, and snippets.

@TommyTheTribe
Created May 29, 2021 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TommyTheTribe/b90586b8a74b1e8eddb9564d2083d705 to your computer and use it in GitHub Desktop.
Save TommyTheTribe/b90586b8a74b1e8eddb9564d2083d705 to your computer and use it in GitHub Desktop.
# ----- build image -----
FROM node:14.15.0-alpine AS build-env
WORKDIR /app
COPY . /app
RUN yarn install
RUN yarn build
RUN mkdir tmp \
&& cp -r build \
package.json \
tsconfig.json \
yarn.lock \
node_modules \
tmp
# ----- final image -----
FROM node:14.15.0-alpine
WORKDIR /app
LABEL maintainer="Tommy Alexandre <tommy.alexandre@thetribe.io>"
COPY --from=build-env /app/tmp /app
EXPOSE 8080
USER node
ENTRYPOINT [ "yarn" ]
CMD [ "start" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment