-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Installed dependencies in Backend container before copying to allow caching - Installed Node Modules in Frontend container - Added Node Modules to .dockerignore for Frontend container - Corrected volume mapping in docker-compose.yml - Updated port back to 5000 from 4000
- Loading branch information
Raj Shah
committed
Sep 28, 2021
1 parent
fc8eac4
commit 7087663
Showing
6 changed files
with
20 additions
and
26 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 @@ | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
# pull official base image | ||
FROM node:14 | ||
|
||
COPY ./package.json /usr/src/app/package.json | ||
# set working directory | ||
WORKDIR . | ||
|
||
# add `/app/node_modules/.bin` to $PATH | ||
WORKDIR /usr/src/app | ||
# install dependencies first so that they can be cached | ||
RUN npm install | ||
EXPOSE 3000 | ||
|
||
# copy the code | ||
COPY . ./ | ||
# start app | ||
CMD ["yarn", "start"] | ||
ENTRYPOINT ["yarn"] | ||
CMD ["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 |
---|---|---|
@@ -1,19 +1,9 @@ | ||
FROM python:3.8 | ||
ADD ../ /usr/src/app | ||
COPY ./requirements.txt /usr/src/app/requirements.txt | ||
This comment has been minimized.
Sorry, something went wrong. |
||
WORKDIR /usr/src/app | ||
EXPOSE 4000 | ||
RUN pip install --upgrade pip | ||
RUN pip install -r requirements.txt | ||
|
||
#FROM node:14.9 | ||
#COPY package*.json ./ | ||
|
||
#RUN npm install | ||
|
||
#COPY . . | ||
|
||
#EXPOSE 3000 | ||
|
||
#CMD [ "yarn", "start" ] | ||
COPY . /usr/src/app | ||
EXPOSE 5000 | ||
ENTRYPOINT ["python"] | ||
CMD ["index.py"] |
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 |
---|---|---|
|
@@ -3,25 +3,27 @@ services: | |
backend: | ||
build: ./backend | ||
ports: | ||
- "4000:4000" | ||
- "5000:5000" | ||
volumes: | ||
- .:/backend/app | ||
- ./backend:/usr/src/app | ||
This comment has been minimized.
Sorry, something went wrong.
shahrk
Owner
|
||
environment: | ||
- ENV=development | ||
- PORT=4000 | ||
- PORT=5000 | ||
- DB=mongodb+srv://bot:[email protected]/feature-hunt?retryWrites=true&w=majority | ||
#- DB=mongodb://mongodb:27017/todoDev | ||
|
||
|
||
frontend: | ||
build: . | ||
volumes: | ||
- '/usr/src/app' | ||
- ./src:/usr/src/app/src | ||
- ./public:/usr/src/app/public | ||
- ./test:/usr/src/app/test | ||
This comment has been minimized.
Sorry, something went wrong.
shahrk
Owner
|
||
ports: | ||
- 8080:3000 | ||
stdin_open: true | ||
|
||
|
||
networks: | ||
default: | ||
name: web_dev | ||
name: feature_hunt |
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
Only copying requirements.txt initially so that when we run
pip install -r requirements.txt
a new image gets created with only the requirements. This will allow for caching as this particular image won't have to be rebuilt whenever code changes are made.