49 lines
1.6 KiB
Plaintext
49 lines
1.6 KiB
Plaintext
#FROM python:3.6-alpine
|
|
FROM python:3.6
|
|
|
|
ENV PYTHONUNBUFFERED 1
|
|
|
|
#RUN apk add --no-cache libev-dev git postgresql-dev gcc python3-dev musl-dev
|
|
|
|
#RUN apt update
|
|
#RUN apt install -y libev-dev libevdev2 git python3-dev
|
|
|
|
# Requirements have to be pulled and installed here, otherwise caching won't work
|
|
COPY ./requirements /requirements
|
|
|
|
|
|
RUN pip install --cache-dir ./cache/pip -r /requirements/local.txt \
|
|
&& groupadd -r django \
|
|
&& useradd -r -g django django
|
|
|
|
COPY . /app
|
|
|
|
RUN mkdir -p /var/log/gunicorn/ \
|
|
&& mkdir -p /data/sockets \
|
|
&& chown -R django /app \
|
|
&& chown -R root:django /var/log/gunicorn/ \
|
|
&& chmod -R 770 /var/log/gunicorn/
|
|
|
|
COPY ./compose/django/dev-gunicorn-mhackspace.sh /dev-gunicorn-mhackspace.sh
|
|
COPY ./compose/django/live-gunicorn-mhackspace.sh /live-gunicorn-mhackspace.sh
|
|
COPY ./compose/django/stage-gunicorn-mhackspace.sh /stage-gunicorn-mhackspace.sh
|
|
COPY ./compose/django/bjoern.py /bjoern.py
|
|
COPY ./compose/django/entrypoint.sh /entrypoint.sh
|
|
RUN sed -i 's/\r//' /entrypoint.sh \
|
|
&& sed -i 's/\r//' /stage-gunicorn-mhackspace.sh \
|
|
&& sed -i 's/\r//' /live-gunicorn-mhackspace.sh \
|
|
&& sed -i 's/\r//' /dev-gunicorn-mhackspace.sh \
|
|
&& chmod +x /entrypoint.sh \
|
|
&& chown django /entrypoint.sh \
|
|
&& chmod +x /dev-gunicorn-mhackspace.sh \
|
|
&& chown django /dev-gunicorn-mhackspace.sh \
|
|
&& chmod +x /stage-gunicorn-mhackspace.sh \
|
|
&& chown django /stage-gunicorn-mhackspace.sh \
|
|
&& chmod +x /live-gunicorn-mhackspace.sh \
|
|
&& chown django /live-gunicorn-mhackspace.sh \
|
|
&& chown django /data/sockets
|
|
|
|
WORKDIR /app
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|