Created
August 29, 2019 13:28
-
-
Save joduplessis/96e1ff998ea4bd865a6427aeab48428a to your computer and use it in GitHub Desktop.
Docker files for a Nodejs websocket service using Redis.
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" | |
services: | |
redis: | |
image: redis | |
container_name: redis | |
ports: | |
- 6379:6379 | |
expose: | |
- 6379 | |
websocket: | |
build: | |
context: ./ | |
dockerfile: ./Dockerfile.development | |
depends_on: | |
- redis | |
container_name: websocket | |
volumes: | |
- ./:/var/www/websocket | |
links: | |
- redis | |
env_file: | |
- .env | |
ports: | |
- 3333:3333 | |
command: | |
sh -c 'npm i && npm run start' |
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" | |
services: | |
websocket: | |
build: | |
context: ./ | |
dockerfile: ./Dockerfile.production | |
container_name: websocket | |
working_dir: /var/www/websocket | |
environment: | |
- REDIS_HOST: ${REDIS_HOST} | |
- REDIS_PORT: ${REDIS_PORT} | |
- PORT: ${PORT} | |
ports: | |
- 3333:3333 | |
command: | |
sh -c 'npm i && npm run start' |
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:10 | |
MAINTAINER Jo du Plessis <jo@joduplessis.com> | |
WORKDIR /var/www/websocket |
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:10 | |
MAINTAINER Jo du Plessis <jo@joduplessis.com> | |
WORKDIR /var/www/websocket | |
COPY . /var/www/websocket |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment