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.
selenium-screenshot-testing
mschwager 2017-03-06 20:17:31 -05:00 committed by Kevin Chung
parent 4b077dfa37
commit e237715b33
1 changed files with 11 additions and 5 deletions

View File

@ -1,7 +1,13 @@
FROM ubuntu:latest FROM ubuntu:16.04
RUN apt-get update -y
RUN apt-get upgrade -y RUN apt update && \
RUN apt-get install build-essential python-dev python-pip libffi-dev mysql-client -y apt install -y \
build-essential \
libffi-dev \
mysql-client \
python-dev \
python-pip && \
rm -rf /var/lib/apt/lists/*
VOLUME ["/opt/CTFd"] VOLUME ["/opt/CTFd"]
@ -17,4 +23,4 @@ RUN chmod +x /opt/CTFd/docker-entrypoint.sh
EXPOSE 8000 EXPOSE 8000
ENTRYPOINT ["/opt/CTFd/docker-entrypoint.sh"] 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"] 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"]