-
Notifications
You must be signed in to change notification settings - Fork 81
/
Dockerfile
47 lines (37 loc) · 1.4 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM ghcr.io/getpatchwork/pyenv:latest
ARG UID
ARG GID
# make sure the user has configured the '.env' file and quick fail if not
RUN echo $UID; echo $GID; \
[ -n "$UID" ] || { echo "You must define UID in .env" 1>&2; exit 1; }; \
[ -n "$GID" ] || { echo "You must define GID in .env" 1>&2; exit 1; }
ARG TZ="Australia/Canberra"
ENV DEBIAN_FRONTEND noninteractive
ENV PYTHONUNBUFFERED 1
ENV PROJECT_HOME /home/patchwork/patchwork
ENV DJANGO_SETTINGS_MODULE patchwork.settings.dev
RUN groupadd --gid=$GID patchwork && \
useradd --uid=$UID --gid=$GID --create-home patchwork
RUN rm -f /etc/localtime; ln -s /usr/share/zoneinfo/$TZ /etc/localtime
RUN eval "$(pyenv init -)"
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libmysqlclient-dev \
libpq-dev \
libsqlite3-dev \
mysql-client \
postgresql-client \
sqlite3 \
tzdata \
pkg-config \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN pip install wheel tox
# we deliberately leave the requirements files in /opt so we can ping the user
# in entrypoint.sh if they change
COPY requirements-dev.txt requirements-test.txt /opt/
RUN pip install -r /opt/requirements-dev.txt
COPY tools/docker/entrypoint.sh /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["python3", "manage.py", "runserver", "0.0.0.0:8000"]
USER patchwork
WORKDIR /home/patchwork/patchwork