-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dockerfile and dockercompose file
- dockerfile will create a image - dockercompose file aggregating all the services this app needs such as- mongo, redis, my-reduxtagram(client)
- Loading branch information
1 parent
63732f6
commit f6df223
Showing
3 changed files
with
68 additions
and
0 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,3 @@ | ||
node_modules | ||
lib | ||
data |
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,25 @@ | ||
FROM node | ||
|
||
# Create app directory | ||
WORKDIR /usr/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 ./ | ||
|
||
#If you are building your code for production | ||
#RUN npm install --only=production | ||
|
||
RUN npm install | ||
|
||
#Bundle app source | ||
|
||
COPY . . | ||
|
||
RUN npm run build | ||
|
||
COPY .env ./lib/ | ||
|
||
EXPOSE 4000 | ||
|
||
CMD ["npm", "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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
version: "3" | ||
services: | ||
reduxtagram-server: | ||
container_name: reduxtagram-server-container | ||
image: reduxtagram-server-image | ||
restart: always | ||
build: . | ||
ports: | ||
- "4000:4000" | ||
environment: | ||
- PORT=4000 | ||
- MONGOIP=mongo | ||
- REDISIP=redis | ||
depends_on: | ||
- mongo | ||
- redis | ||
reduxtagram-client: | ||
container_name: my-reduxtagram-container | ||
image: my-reduxtagram-image | ||
restart: always | ||
build: . | ||
ports: | ||
- "3000:3000" | ||
|
||
mongo: | ||
container_name: mongo | ||
restart: always | ||
image: mongo | ||
volumes: | ||
- ./data/mongodb:/data/db | ||
ports: | ||
- "27017:27017" | ||
|
||
redis: | ||
container_name: redis | ||
image: redis | ||
volumes: | ||
- ./data/redis:/data/db | ||
ports: | ||
- "6379:6379" |