File tree Expand file tree Collapse file tree 5 files changed +16
-11
lines changed
Expand file tree Collapse file tree 5 files changed +16
-11
lines changed Original file line number Diff line number Diff line change 1- FROM python:3.8.3-alpine3.12
1+ FROM python:3.9-alpine
22
33LABEL maintainer="eshaan7bansal@gmail.com"
44
55# Env
6- RUN export DATABASE_URL="postgres ://${DB_USER}:${DB_PASSWORD}@postgres:${DB_PORT}/${DB_NAME}" \
6+ RUN export DATABASE_URL="postgresql ://${DB_USER}:${DB_PASSWORD}@postgres:${DB_PORT}/${DB_NAME}" \
77 && export REDIS_URL="redis://redis:6379/0"
88
99# update and install packages
1010RUN apk update --no-cache \
1111 && apk add --no-cache postgresql-dev build-base g++ libffi-dev
1212
13- # Add a new low-privileged user
14- RUN adduser --shell /sbin/login www-data -DH
13+ # ensure www-data user exists (low-privileged user)
14+ RUN set -x ; \
15+ addgroup -g 82 -S www-data ; \
16+ adduser -u 82 -D -S -G www-data www-data && exit 0 ; exit 1
1517
1618# Install RTB-CTF-Framework
1719WORKDIR /usr/src/app
Original file line number Diff line number Diff line change @@ -28,9 +28,9 @@ services:
2828 restart : unless-stopped
2929 expose :
3030 - " 6379"
31-
31+
3232 nginx :
33- image : library/nginx:1.16.1 -alpine
33+ image : library/nginx:1.21 -alpine
3434 container_name : rtb_nginx
3535 restart : unless-stopped
3636 hostname : nginx
Original file line number Diff line number Diff line change @@ -19,17 +19,17 @@ services:
1919 expose :
2020 - " 5432"
2121 env_file :
22- - .env_postgres
22+ - .env_postgres
2323
2424 redis :
2525 image : redis:alpine3.12
2626 container_name : rtb_redis
2727 restart : unless-stopped
2828 expose :
2929 - " 6379"
30-
30+
3131 nginx :
32- image : library/nginx:1.16.1 -alpine
32+ image : library/nginx:1.21 -alpine
3333 container_name : rtb_nginx
3434 restart : unless-stopped
3535 hostname : nginx
Original file line number Diff line number Diff line change 1- python-3.8.7
1+ python-3.9.6
Original file line number Diff line number Diff line change 66class Config :
77 DEBUG = False # Turn DEBUG OFF before deployment
88 SECRET_KEY = os .environ .get ("SECRET_KEY" , "you-will-never-guess" )
9- SQLALCHEMY_DATABASE_URI = os .environ .get ("DATABASE_URL" ) or "sqlite:///site.db"
9+ _uri = os .environ .get ("DATABASE_URL" ) or "sqlite:///site.db"
10+ if _uri .startswith ("postgres://" ):
11+ _uri = _uri .replace ("postgres://" , "postgresql://" , 1 )
12+ SQLALCHEMY_DATABASE_URI = _uri
1013 # For local use, one can simply use SQLlite with: 'sqlite:///site.db'
1114 # For deployment on Heroku use: `os.environ.get('DATABASE_URL')`
1215 # in all other cases: `os.environ.get('SQLALCHEMY_DATABASE_URI')`
You can’t perform that action at this time.
0 commit comments