Last active
June 10, 2020 09:35
-
-
Save narongdejsrn/1404f93aec306edf47652429ecfc7d20 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.6-buster | |
ENV PYTHONUNBUFFERED 1 | |
# ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.2.1/wait /wait | |
# RUN chmod +x /wait | |
# required for pydot to work | |
RUN apt-get update && apt-get install -y python-pygraphviz postgresql-client software-properties-common && rm -rf /var/lib/apt/lists/* | |
RUN echo 'deb http://deb.debian.org/debian buster-backports main' >> /etc/apt/sources.list && apt update \ | |
&& apt install -y -t buster-backports libreoffice | |
RUN curl -o /usr/bin/unoconv https://raw.githubusercontent.com/dagwieers/unoconv/master/unoconv | |
RUN sed -i '1s+.*+#!/usr/bin/python3+' /usr/bin/unoconv | |
RUN chmod +x /usr/bin/unoconv | |
RUN apt-get update && apt-get install ghostscript -y | |
RUN mkdir /code | |
WORKDIR /code | |
COPY requirements.txt /code/ | |
RUN pip install -r requirements.txt | |
ADD . /code/ | |
RUN mkdir -p /code/routing/uploaded_files/ | |
RUN mkdir -p /code/routing/generated_report/ | |
# uWSGI will listen on this port | |
EXPOSE 8000 | |
# Call collectstatic (customize the following line with the minimal environment variables needed for manage.py to run): | |
RUN python manage.py collectstatic --noinput | |
# ENV GOOGLE_APPLICATION_CREDENTIALS=/code/routing/credential/google-cloud-key.json | |
# Tell uWSGI where to find your wsgi file (change this): | |
ENV UWSGI_WSGI_FILE=boat_routing/wsgi.py | |
# Base uWSGI configuration (you shouldn't need to change these): | |
ENV UWSGI_HTTP=:8000 UWSGI_MASTER=1 UWSGI_HTTP_AUTO_CHUNKED=1 UWSGI_HTTP_KEEPALIVE=1 UWSGI_LAZY_APPS=1 UWSGI_WSGI_ENV_BEHAVIOR=holy | |
# Number of uWSGI workers and threads per worker (customize as needed): | |
ENV UWSGI_WORKERS=1 UWSGI_THREADS=4 | |
# uWSGI static file serving configuration (customize or comment out if not needed): | |
ENV UWSGI_STATIC_MAP="/backend/static/=/code/backend/static/" UWSGI_STATIC_EXPIRES_URI="/backend/static/.*\.[a-f0-9]{12,}\.(css|js|png|jpg|jpeg|gif|ico|woff|ttf|otf|svg|scss|map|txt) 315360000" | |
# Deny invalid hosts before they get to Django (uncomment and change to your hostname(s)): | |
# ENV UWSGI_ROUTE_HOST="^(?!localhost:8000$) break:400" | |
# Uncomment after creating your docker-entrypoint.sh | |
# ENTRYPOINT ["/code/docker-entrypoint.sh"] | |
RUN chmod +x /code/docker-entrypoint.sh | |
# Start uWSGI | |
ENTRYPOINT ["/code/docker-entrypoint.sh"] | |
CMD ["uwsgi"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment