Created
April 28, 2020 07:46
-
-
Save beeman/8109822eea0fdf121e9b5a0b42ac9373 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
FROM node:12-alpine | |
# FROM node:12 use the Ubuntu-based versions if you have issues building deps on Alpine | |
# Set some Yarn settings | |
RUN yarn config set cache-folder ~/.yarn \ | |
&& yarn config set network-timeout 300000 -g \ | |
&& yarn config set prefer-offline true | |
# Create app directory | |
WORKDIR /workspace | |
# We copy these separately so this step only gets triggered when package.json changes. | |
COPY package.json yarn.lock /workspace/ | |
# Install app dependencies | |
RUN yarn | |
# Copy source files | |
COPY . . | |
# Build app | |
RUN yarn build:api | |
# Expose the port | |
EXPOSE 7900 | |
# Run Node with the built | |
CMD [ "node", "dist/apps/api/main" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment