Skip to content

Instantly share code, notes, and snippets.

@beeman
Created April 28, 2020 07:46
Show Gist options
  • Save beeman/8109822eea0fdf121e9b5a0b42ac9373 to your computer and use it in GitHub Desktop.
Save beeman/8109822eea0fdf121e9b5a0b42ac9373 to your computer and use it in GitHub Desktop.
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