Skip to content

Commit 22a0780

Browse files
committed
Update Docker Scripts
1 parent 59787da commit 22a0780

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

Dockerfile

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
FROM python:3.6
1+
FROM python:3.9
22

3-
ENV FLASK_APP run.py
3+
# set environment variables
4+
ENV PYTHONDONTWRITEBYTECODE 1
5+
ENV PYTHONUNBUFFERED 1
46

5-
COPY manage.py gunicorn-cfg.py requirements.txt .env ./
6-
COPY app app
7-
COPY authentication authentication
8-
COPY core core
7+
COPY requirements.txt .
8+
# install python dependencies
9+
RUN pip install --upgrade pip
10+
RUN pip install --no-cache-dir -r requirements.txt
911

10-
RUN pip install -r requirements.txt
12+
COPY . .
1113

12-
RUN python manage.py makemigrations
14+
# running migrations
1315
RUN python manage.py migrate
1416

15-
EXPOSE 5005
17+
# gunicorn
1618
CMD ["gunicorn", "--config", "gunicorn-cfg.py", "core.wsgi"]

docker-compose.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
version: '3'
1+
version: '3.8'
22
services:
33
appseed-app:
4+
container_name: appseed_app
45
restart: always
5-
env_file: .env
66
build: .
7-
ports:
8-
- "5005:5005"
97
networks:
108
- db_network
119
- web_network
1210
nginx:
11+
container_name: nginx
1312
restart: always
1413
image: "nginx:latest"
1514
ports:
16-
- "85:85"
15+
- "5085:5085"
1716
volumes:
1817
- ./nginx:/etc/nginx/conf.d
1918
networks:

nginx/appseed-app.conf

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
upstream webapp {
2+
server appseed_app:5005;
3+
}
4+
15
server {
2-
listen 85;
6+
listen 5085;
7+
server_name localhost;
38

49
location / {
5-
proxy_pass http://localhost:5005/;
10+
proxy_pass http://webapp;
611
proxy_set_header Host $host;
712
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
813
}

0 commit comments

Comments
 (0)