Files
CTFd/Dockerfile
mschwager e237715b33 Pin Ubuntu version and follow Dockerfile best practices (#218)
Docker provides some useful resources for Ubuntu as a base image
and installing software via apt-get:

https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#apt-get

It's also useful to pin the Ubuntu version to 16.04 so we have a good
idea of what OS we're using in the image. To that end, I think we can
also avoid performing an upgrade so we can even further control which
versions of software we're using. If we do an upgrade then you'll have
different versions of software depending on when you build the image.
2017-03-06 20:17:31 -05:00

27 lines
635 B
Docker

FROM ubuntu:16.04
RUN apt update && \
apt install -y \
build-essential \
libffi-dev \
mysql-client \
python-dev \
python-pip && \
rm -rf /var/lib/apt/lists/*
VOLUME ["/opt/CTFd"]
RUN mkdir -p /opt/CTFd
COPY . /opt/CTFd
WORKDIR /opt/CTFd
RUN pip install -r requirements.txt
RUN pip install pymysql
RUN chmod +x /opt/CTFd/docker-entrypoint.sh
EXPOSE 8000
ENTRYPOINT ["/opt/CTFd/docker-entrypoint.sh"]
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "-w", "4", "CTFd:create_app()", "--access-logfile", "/opt/CTFd/CTFd/logs/access.log", "--error-logfile", "/opt/CTFd/CTFd/logs/error.log"]