forked from abs0lut3pwn4g3/RTB-CTF-Framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
28 lines (21 loc) · 775 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM python:3.9-alpine
LABEL maintainer="[email protected]"
# Env
RUN export DATABASE_URL="postgresql://${DB_USER}:${DB_PASSWORD}@postgres:${DB_PORT}/${DB_NAME}" \
&& export REDIS_URL="redis://redis:6379/0"
# update and install packages
RUN apk update --no-cache \
&& apk add --no-cache postgresql-dev build-base g++ libffi-dev
# ensure www-data user exists (low-privileged user)
RUN set -x ; \
addgroup -g 82 -S www-data ; \
adduser -u 82 -D -S -G www-data www-data && exit 0 ; exit 1
# Install RTB-CTF-Framework
WORKDIR /usr/src/app
COPY src ./
RUN chown -R www-data ./
RUN pip install --no-cache-dir -r requirements.txt
USER www-data
EXPOSE 8000
RUN chmod +x /usr/src/app/docker-entrypoint.sh
ENTRYPOINT [ "/usr/src/app/docker-entrypoint.sh" ]