-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (42 loc) · 1.78 KB
/
Dockerfile
File metadata and controls
49 lines (42 loc) · 1.78 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM python:3.7-slim-bullseye
WORKDIR /opt/CTFd
RUN mkdir -p /opt/CTFd /var/log/CTFd /var/uploads
# hadolint ignore=DL3008
RUN echo 'deb http://mirrors.aliyun.com/debian/ bullseye main non-free contrib \
deb http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib \
deb http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib \
deb-src http://mirrors.aliyun.com/debian/ bullseye main non-free contrib \
deb-src http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib \
deb-src http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib \
deb http://mirrors.aliyun.com/debian-security/ bullseye/updates main non-free contrib \
deb-src http://mirrors.aliyun.com/debian-security/ bullseye/updates main non-free contrib'> /etc/apt/sources.list && \
apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
default-mysql-client \
python3-dev \
libffi-dev \
libssl-dev \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt /opt/CTFd/
RUN pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com --no-cache-dir
COPY . /opt/CTFd
# hadolint ignore=SC2086
RUN for d in CTFd/plugins/*; do \
if [ -f "$d/requirements.txt" ]; then \
pip install -r $d/requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com --no-cache-dir; \
fi; \
done;
RUN adduser \
--disabled-login \
-u 1001 \
--gecos "" \
--shell /bin/bash \
ctfd
RUN chmod +x /opt/CTFd/docker-entrypoint.sh \
&& chown -R 1001:1001 /opt/CTFd /var/log/CTFd /var/uploads
USER 1001
EXPOSE 8000
ENTRYPOINT ["/opt/CTFd/docker-entrypoint.sh"]