-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #200 from withinboredom/master
Add docker to yeoman generator
- Loading branch information
Showing
5 changed files
with
115 additions
and
7 deletions.
There are no files selected for viewing
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
5 changes: 5 additions & 0 deletions
5
packages/generator-react-server/generators/app/templates/Dockerfile
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM node:slim | ||
|
||
EXPOSE 3000 | ||
ENV NODE_ENV=docker-dev | ||
VOLUME /www |
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
22 changes: 22 additions & 0 deletions
22
packages/generator-react-server/generators/app/templates/docker-compose.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
version: '2' | ||
services: | ||
react_server: # The label of the service | ||
build: . # The location of the Dockerfile to build | ||
volumes: # Files to share with the container and the host | ||
- .:/www # Share the project in /www in the container | ||
- react_server_node_modules:/www/node_modules # A special volume so that OS specific node_modules are built correctly | ||
working_dir: /www # The location all commands should run from | ||
environment: | ||
NODE_ENV: 'docker' # Set the NODE_ENV environment variable | ||
command: /bin/bash -c "npm install && npm start" # The command to run in when the container starts | ||
ports: # Ports to expose to your host | ||
- '3000:3000' | ||
- '3001:3001' | ||
# An example database | ||
# my_db: | ||
# image: rethinkdb:latest | ||
# You can reference the db/service by using the dns name `my_db` and docker will do the rest | ||
|
||
# Volume to store separate from the container runtime and host | ||
volumes: | ||
react_server_node_modules: |
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