forked from cefjoeii/mern-crud
-
Notifications
You must be signed in to change notification settings - Fork 0
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 cefjoeii#5 from espizo/docker-support
Add docker support
- Loading branch information
Showing
5 changed files
with
60 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM node:latest | ||
|
||
RUN mkdir -p /usr/src/app/react-src | ||
WORKDIR /usr/src/app | ||
|
||
RUN npm install -g nodemon | ||
|
||
COPY package.json /usr/src/app/ | ||
RUN npm install | ||
|
||
COPY react-src/package.json /usr/src/app/react-src | ||
RUN npm install | ||
|
||
COPY . /usr/src/app | ||
|
||
EXPOSE 3000 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
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,31 @@ | ||
version: '2' | ||
services: | ||
db: | ||
image: mongo:latest | ||
api: | ||
build: . | ||
image: mern-crud | ||
command: nodemon server | ||
ports: | ||
- "3000:3000" | ||
environment: | ||
- "DB=mongodb://db/mern-crud" | ||
- "CORS=1" | ||
- "DEBUG=express:*" | ||
volumes: | ||
- .:/usr/src/app | ||
- /usr/src/app/node_modules | ||
depends_on: | ||
- db | ||
web: | ||
image: mern-crud | ||
command: npm start --prefix react-src | ||
ports: | ||
- "4200:4200" | ||
environment: | ||
- "REACT_APP_API_URL=http://localhost:3000" | ||
volumes: | ||
- ./react-src:/usr/src/app/react-src | ||
- /usr/src/app/react-src/node_modules | ||
depends_on: | ||
- api |
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
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