Created
May 18, 2020 11:52
-
-
Save primayudantra/78071786abf8f503817c589e77ed39b1 to your computer and use it in GitHub Desktop.
node-docker
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
redis: | |
image: redis | |
container_name: cache_service | |
expose: | |
- 6379 | |
app: | |
build: ./ | |
volumes: | |
- ./:/var/www/app | |
- .env.docker:/var/www/app/.env | |
environment: | |
- REDIS_URL=redis://jobkred_mailer_cache | |
links: | |
- redis | |
ports: | |
- 4000:4000 |
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:12 | |
# Create app directory | |
WORKDIR /usr/src/app | |
# Install app dependencies | |
# A wildcard is used to ensure both package.json AND package-lock.json are copied | |
# where available (npm@5+) | |
COPY package*.json ./ | |
RUN npm install | |
RUN npm install pm2 -g | |
# If you are building your code for production | |
RUN npm ci --only=production | |
# Bundle app source | |
COPY . . | |
EXPOSE 4000 | |
CMD ["pm2-runtime", "start", "index.js"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment