File tree Expand file tree Collapse file tree 8 files changed +23
-29
lines changed Expand file tree Collapse file tree 8 files changed +23
-29
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,6 @@ WORKDIR /usr/src/app/messages/
31
31
32
32
EXPOSE 8000
33
33
34
- COPY entrypoint.sh .
35
- RUN chmod +x entrypoint.sh
36
-
37
34
USER app-user
38
35
39
36
CMD ["run.sh" ]
Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ services:
4
4
build :
5
5
context : .
6
6
dockerfile : Dockerfile
7
- entrypoint : ./entrypoint.sh
7
+ command : >
8
+ sh -c "python manage.py wait_for_db &&
9
+ python manage.py migrate &&
10
+ python manage.py runserver 0.0.0.0:8000"
8
11
image : messages-web-image
9
12
container_name : messages-web-container
10
13
ports :
Original file line number Diff line number Diff line change 1
1
FROM nginxinc/nginx-unprivileged:1-alpine
2
2
3
3
COPY ./default.conf.tpl /etc/nginx/default.conf.tpl
4
- COPY ./uwsgi_params /etc/nginx/uwsgi_params
5
4
COPY ./run.sh /run.sh
6
5
7
- ENV LISTEN_PORT=8000
8
- ENV APP_HOST=web
9
- ENV APP_PORT=9000
10
-
11
6
USER root
12
7
13
8
RUN mkdir -p /vol/static && \
14
9
chmod 755 /vol/static && \
15
10
touch /etc/nginx/conf.d/default.conf && \
16
11
chown nginx:nginx /etc/nginx/conf.d/default.conf && \
12
+ chown nginx:nginx /etc/nginx/default.conf.tpl && \
17
13
chmod +x /run.sh
18
14
19
15
VOLUME /vol/static
Original file line number Diff line number Diff line change
1
+ upstream server_ws {
2
+ server web:8001;
3
+ }
4
+
1
5
server {
2
- listen ${LISTEN_PORT } ;
6
+ listen 8000 ;
3
7
4
8
location /static {
5
9
alias /vol/static;
6
10
}
7
11
8
12
location / {
9
- uwsgi_pass ${APP_HOST} :${ APP_PORT} ;
10
- include /etc/nginx/uwsgi_params;
11
- client_max_body_size 10M;
13
+ proxy_pass http://server_ws;
14
+
15
+ proxy_http_version 1.1;
16
+ proxy_set_header Upgrade $http_upgrade ;
17
+ proxy_set_header Connection " upgrade" ;
18
+
19
+ proxy_redirect off;
20
+ proxy_set_header Host $host ;
21
+ proxy_set_header X-Real-IP $remote_addr ;
22
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
23
+ proxy_set_header X-Forwarded-Host $server_name ;
12
24
}
13
25
}
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
- envsubst < /etc/nginx/default.conf.tpl > /etc/nginx/conf.d/default.conf
3
+ cat /etc/nginx/default.conf.tpl > /etc/nginx/conf.d/default.conf
4
4
nginx -g ' daemon off;'
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -44,7 +44,6 @@ toml==0.10.2
44
44
Twisted == 22.10.0
45
45
txaio == 22.2.1
46
46
typing_extensions == 4.4.0
47
- uWSGI == 2.0.21
48
47
virtualenv == 20.16.6
49
48
wrapt == 1.14.1
50
49
zope.interface == 5.5.1
Original file line number Diff line number Diff line change @@ -6,4 +6,4 @@ python manage.py wait_for_db
6
6
python manage.py collectstatic --noinput
7
7
python manage.py migrate
8
8
9
- uwsgi --socket :9000 --workers 4 --master --enable-threads --module messages.wsgi
9
+ daphne -b 0.0.0.0 -p 8001 messages.asgi:application
You can’t perform that action at this time.
0 commit comments