Skip to content

Instantly share code, notes, and snippets.

@guigmaster
Created February 26, 2020 19:06
Show Gist options
  • Save guigmaster/2e11856dd27592188e97b869ba995cb3 to your computer and use it in GitHub Desktop.
Save guigmaster/2e11856dd27592188e97b869ba995cb3 to your computer and use it in GitHub Desktop.
Docker for Angular Projects
node_modules
.git
.gitignore
version: "3.6"
services:
app:
build: .
volumes:
- .:/home/node/api
- /home/node/api/node_modules
command: npm start -- --host 0.0.0.0
ports:
- 4200:4200
FROM node:lts-alpine
RUN mkdir -p /home/node/api/node_modules && chown -R node:node /home/node/api
WORKDIR /home/node/api
COPY package*.json ./
USER node
RUN npm install
COPY --chown=node:node . .
CMD ["npm", "start"]
EXPOSE 4200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment