-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile
55 lines (40 loc) · 1.38 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
48
49
50
51
52
53
54
55
FROM python:3.10
ENV PIP_DISABLE_PIP_VERSION_CHECK 1
RUN python3 -m venv /pyenv
ENV VIRTUAL_ENV /pyenv
ENV PATH=/pyenv/bin:$PATH
RUN mkdir /source
WORKDIR /source/
RUN pip install pip-tools
# Install environment dependencies
RUN apt-get update && apt-get install -y \
libmagic1 \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY requirements.txt /source/
COPY requirements-deploy.txt /source/
RUN pip-sync requirements.txt requirements-deploy.txt
# Install Application
COPY setup.py README.md /source/
COPY dashboard/ /source/dashboard/
RUN pip install --no-deps -e .[deploy]
RUN ln -s /pyenv/bin/dashboard /usr/local/bin/
WORKDIR /
USER root
# configuration for django-uwsgi to work correct in Docker environment
ENV UWSGI_GID root
ENV UWSGI_UID root
ENV UWSGI_MODULE dashboard.wsgi
# serve static files (to caching proxy) from collected/generated static files
ENV UWSGI_STATIC_MAP /static=/srv/dashboard/static
# set proxy and browser caching for static files to 1 month
ENV UWSGI_STATIC_EXPIRES /* 2678400
ENV TOOLS_DIR /usr/local/bin/
ENV VENDOR_DIR /source/vendor/
# collect all static files form all django applications into static files directory
RUN /usr/local/bin/dashboard collectstatic
ARG VERSION=0.0.0-docker0
RUN echo "VERSION='$VERSION'" >> /source/dashboard/__version__.py
EXPOSE 8000
ENTRYPOINT [ "/usr/local/bin/dashboard" ]
CMD [ "dashboard_prdserver" ]