-
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.
added dockerfile for backend and frontend.
added docker-compose for development stage.
- Loading branch information
1 parent
ff9d59b
commit 1cadeeb
Showing
15 changed files
with
107 additions
and
107 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 |
---|---|---|
|
@@ -98,4 +98,7 @@ ENV/ | |
.ropeproject | ||
|
||
# Project upload dir | ||
src/app/upload/** | ||
src/app/upload/** | ||
|
||
# db docker folder | ||
db |
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,51 @@ | ||
version: '3.7' | ||
services: | ||
db: | ||
image: 'mysql:8.0.19' | ||
volumes: | ||
- './db/data:/var/lib/mysql' | ||
command: '--default-authentication-plugin=mysql_native_password' | ||
restart: always | ||
secrets: | ||
- db-password | ||
networks: | ||
- backend-network | ||
environment: | ||
- MYSQL_DATABASE=graphue | ||
- MYSQL_USER=root | ||
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db-password | ||
api: | ||
build: | ||
context: ./src | ||
target: develop-stage | ||
container_name: api | ||
restart: always | ||
ports: | ||
- '5000:5000' | ||
volumes: | ||
- './src/:/src' | ||
command: /bin/sh -c "FLASK_ENV=development python manage.py" | ||
networks: | ||
- backend-network | ||
- frontend-network | ||
ui: | ||
build: | ||
context: ./src/template | ||
target: develop-stage | ||
container_name: ui | ||
restart: always | ||
ports: | ||
- '8080:8080' | ||
volumes: | ||
- './src/template:/template' | ||
command: /bin/sh -c "yarn serve" | ||
networks: | ||
- frontend-network | ||
volumes: | ||
db: null | ||
secrets: | ||
db-password: | ||
file: db/password.txt | ||
networks: | ||
backend-network: null | ||
frontend-network: null |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,2 @@ | ||
template | ||
__pycache__/ |
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 @@ | ||
FLASK_APP=manage.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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# develop stage | ||
FROM python:3.6 as develop-stage | ||
ENV LANG C.UTF-8 | ||
ENV LC_ALL C.UTF-8 | ||
WORKDIR /src | ||
COPY requirements.txt ./ | ||
RUN pip install -r requirements.txt | ||
ADD . . | ||
|
||
# build stage | ||
FROM python:3.6 as build-stage | ||
WORKDIR /src | ||
COPY requirements.txt ./ | ||
RUN pip install -r requirements.txt | ||
COPY . . | ||
|
||
# Production stage | ||
FROM python:3.6 as production-stage | ||
EXPOSE 5000 | ||
CMD gunicorn -b 0.0.0.0:5000 --worker-class eventlet -w 3 manage:app --max-requests 10000 --timeout 5 --keep-alive 5 --log-level info -e FLASK_ENV=production |
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 |
---|---|---|
|
@@ -89,6 +89,5 @@ tzlocal==2.1 | |
Unidecode==1.1.1 | ||
uritemplate==3.0.1 | ||
urllib3==1.25.9 | ||
uWSGI==2.0.19.1 | ||
Werkzeug==0.16.1 | ||
zipp==3.1.0 |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# develop stage | ||
FROM node:12.14.0-alpine as develop-stage | ||
WORKDIR /template | ||
COPY package*.json ./ | ||
RUN yarn | ||
ADD . . | ||
|
||
# build stage | ||
FROM node:12.14.0-alpine as build-stage | ||
WORKDIR /template | ||
COPY package*.json ./ | ||
RUN yarn | ||
COPY . . | ||
RUN yarn build | ||
|
||
# Production stage | ||
FROM nginx:1.16.1-alpine as production-stage | ||
COPY --from=build-stage /template/dist /usr/share/nginx/html | ||
EXPOSE 80 | ||
CMD [ "nginx", "-g", "daemon off;"] |
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
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 was deleted.
Oops, something went wrong.