-
Notifications
You must be signed in to change notification settings - Fork 17
/
Dockerfile
39 lines (28 loc) · 958 Bytes
/
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
FROM python:3.9-buster
LABEL maintainer "ODL DevOps <[email protected]>"
# Add package files, install updated node and pip
WORKDIR /tmp
COPY apt.txt /tmp/apt.txt
RUN apt-get update
RUN apt-get install -y $(grep -vE "^\s*#" apt.txt | tr "\n" " ")
RUN apt-get update && apt-get install libpq-dev postgresql-client -y
# pip
RUN curl --silent --location https://bootstrap.pypa.io/get-pip.py | python3 -
# Add, and run as, non-root user.
RUN mkdir /src
RUN adduser --disabled-password --gecos "" mitodl
RUN mkdir /var/media && chown -R mitodl:mitodl /var/media
# Install project packages
COPY *requirements.txt /tmp/
RUN pip install -r requirements.txt -r test_requirements.txt
# Add project
COPY . /src
WORKDIR /src
RUN chown -R mitodl:mitodl /src
RUN apt-get clean && apt-get purge
USER mitodl
# Set pip cache folder, as it is breaking pip when it is on a shared volume
ENV XDG_CACHE_HOME /tmp/.cache
EXPOSE 8079
ENV PORT 8079
CMD uwsgi uwsgi.ini