-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created challenges section,with categories & tags. Now using ReprMixi…
…n for model representation and TimeMixin for timestamp fields. dockerfile updated
- Loading branch information
Showing
34 changed files
with
847 additions
and
322 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
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 |
---|---|---|
@@ -1,10 +1,28 @@ | ||
FROM python:3 | ||
FROM python:3.8.2-alpine3.11 | ||
|
||
MAINTAINER [email protected] | ||
|
||
# Env | ||
RUN export DATABASE_URL="postgres://${DB_USER}:${DB_PASSWORD}@postgres:${DB_PORT}/${DB_NAME}" \ | ||
&& export REDIS_URL="redis://redis:6379/0" | ||
|
||
# update and install packages | ||
RUN apk update \ | ||
&& apk add libpq postgresql-dev \ | ||
&& apk add build-base \ | ||
&& apk add --no-cache git libssl1.1 g++ make libffi-dev | ||
|
||
# Add a new low-privileged user | ||
RUN adduser --shell /sbin/login www-data -DH | ||
|
||
# Install RTB-CTF-Framework | ||
WORKDIR /usr/src/app | ||
COPY src ./ | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
EXPOSE 8080 | ||
RUN chown -R 1001:1001 . | ||
USER 1001 | ||
RUN pip install --no-cache-dir -r requirements.txt \ | ||
&& chown -R www-data ./ | ||
|
||
USER www-data | ||
|
||
EXPOSE 8000 | ||
RUN chmod +x /usr/src/app/docker-entrypoint.sh | ||
ENTRYPOINT [ "/usr/src/app/docker-entrypoint.sh" ] |
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 |
---|---|---|
@@ -1,8 +1,55 @@ | ||
version: "3" | ||
|
||
services: | ||
rtbd: | ||
rtbctf: | ||
build: . | ||
container_name: rtb_gunicorn | ||
restart: unless-stopped | ||
ports: | ||
- 80:8080 | ||
restart: unless-stopped | ||
- "80:8000" | ||
expose: | ||
- 8000 | ||
environment: | ||
- DEBUG=False | ||
- SECRET_KEY=changeme | ||
- DB_USER=eshaan | ||
- DB_PASSWORD=eshaan | ||
- DB_NAME=rtbctf | ||
- DB_PORT=5432 | ||
- WORKERS=8 | ||
- ADMIN_PASS=admin | ||
depends_on: | ||
- postgres | ||
- redis | ||
|
||
postgres: | ||
image: library/postgres:12.1-alpine | ||
container_name: rtb_postgres | ||
restart: unless-stopped | ||
expose: | ||
- "5432" | ||
environment: | ||
- POSTGRES_USER=eshaan | ||
- POSTGRES_PASSWORD=eshaan | ||
- POSTGRES_DB=rtbctf | ||
|
||
redis: | ||
image: redis:6.0-rc4-alpine | ||
container_name: rtb_redis | ||
restart: unless-stopped | ||
expose: | ||
- "6379" | ||
|
||
|
||
# nginx: | ||
# image: library/nginx:1.16.1-alpine | ||
# container_name: rtb_nginx | ||
# restart: unless-stopped | ||
# hostname: nginx | ||
# volumes: | ||
# - ./rtb_nginx_http:/etc/nginx/conf.d/default.conf | ||
# ports: | ||
# - "80:80" | ||
# - "443:443" | ||
# depends_on: | ||
# - rtbctf |
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,16 @@ | ||
# the upstream component nginx needs to connect to | ||
upstream flask { | ||
server rtbctf:8000 fail_timeout=30s; | ||
} | ||
|
||
|
||
server { | ||
listen 80; | ||
|
||
server_name rtbctf.com; | ||
|
||
location / { | ||
proxy_pass http://localhost:8000/ | ||
} | ||
|
||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Oops, something went wrong.