Created
February 26, 2020 19:06
-
-
Save guigmaster/2e11856dd27592188e97b869ba995cb3 to your computer and use it in GitHub Desktop.
Docker for Angular Projects
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
node_modules | |
.git | |
.gitignore |
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
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 |
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
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