Last active
December 3, 2017 08:56
-
-
Save talk2MeGooseman/796e1de24a085ff465a173ea405c14f7 to your computer and use it in GitHub Desktop.
Simple docker file setup for node server
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
version: "3" | |
services: | |
server: | |
build: . | |
volumes: | |
- .:/app | |
- /app/node_modules | |
ports: | |
- "3000:3000" |
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
# create a file named Dockerfile | |
FROM node:alpine | |
WORKDIR /app | |
COPY package.json yarn.lock ./ | |
RUN yarn install --production | |
COPY . ./ | |
EXPOSE 3000 | |
CMD ["npm", "start"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment