File tree 4 files changed +56
-7
lines changed
4 files changed +56
-7
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,15 @@ services:
3
3
web :
4
4
build : .
5
5
env_file :
6
- - .env.dev
6
+ - ./. env.prod
7
7
depends_on :
8
- - db
8
+ - db
9
+ expose :
10
+ - 5000
9
11
ports :
10
- - 5000:5000
12
+ - 5000:5000
11
13
volumes :
12
- - .:/web
14
+ - .:/web
13
15
redis :
14
16
image : redis
15
17
db :
@@ -19,8 +21,20 @@ services:
19
21
POSTGRES_DB : flashlearn
20
22
image : postgres:latest
21
23
networks :
22
- - default
24
+ - default
23
25
ports :
24
- - 5405:5432
26
+ - 5405:5432
27
+ env_file :
28
+ - ./.env.prod
25
29
volumes :
26
- - ./postgres-data:/var/lib/postgresql/data
30
+ - ./postgres-data:/var/lib/postgresql/data
31
+ nginx :
32
+ build : ./nginx
33
+ ports :
34
+ - 1337:80
35
+ depends_on :
36
+ - web
37
+
38
+ volumes :
39
+ postgres-data :
40
+ external : true
Original file line number Diff line number Diff line change
1
+ FROM nginx:1.17-alpine
2
+
3
+ RUN rm /etc/nginx/nginx.conf
4
+ COPY ./nginx.conf /etc/nginx/
5
+ RUN rm /etc/nginx/conf.d/default.conf
6
+ COPY ./nginx.conf /etc/nginx/conf.d/
Original file line number Diff line number Diff line change
1
+ upstream web {
2
+ server web:5000;
3
+ server localhost:5000;
4
+ server 127.0.0.1:5000;
5
+ }
6
+
7
+ server {
8
+
9
+ listen 80 ;
10
+ server_name flashlearn_nginx;
11
+
12
+ location / {
13
+ proxy_pass http://web/;
14
+
15
+ # Do not change this
16
+ proxy_set_header Host $host ;
17
+ proxy_set_header X-Real-IP $remote_addr ;
18
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
19
+ }
20
+
21
+ location /static {
22
+ rewrite ^/static(.*) /$1 break;
23
+ root /static;
24
+ }
25
+ }
Original file line number Diff line number Diff line change
1
+ import sys
2
+ import logging
1
3
from flashlearn import create_app
2
4
5
+ logging .basicConfig (stream = sys .stderr )
6
+ sys .path .insert (0 , "/var/www/" )
3
7
app = create_app ()
4
8
5
9
if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments