-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
57 lines (45 loc) · 1.22 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
56
57
FROM python:3.8.19-slim
ARG mode=production
ENV \
DJANGO_SETTINGS_MODULE=score.settings.${mode} \
PHORUM_DB_HOST=postgres \
PHORUM_DB_NAME=score \
PHORUM_DB_USER=score \
PHORUM_DB_PASSWORD=score \
PHORUM_SECRET_KEY=dummy \
PHORUM_EMAIL_HOST=smtp
RUN \
apt-get update && \
apt-get install -y \
libfreetype6-dev \
gcc \
libjpeg-dev \
libffi-dev \
libpng-dev \
make \
netcat-traditional \
rsync \
ruby-bundler \
ruby-dev && \
apt-get clean
COPY ./src/requirements /usr/src/app/requirements
COPY ./src/Gemfile /usr/src/app/Gemfile
RUN \
pip install --no-cache-dir -r /usr/src/app/requirements/${mode}.txt && \
cd /usr/src/app && \
bundle install
COPY ./src /usr/src/app
RUN \
mkdir -p /srv/app/media && \
mkdir -p /srv/app/protected && \
mkdir -p /srv/app/static && \
chown -R www-data:www-data /usr/src/app /srv/app
RUN \
cd /usr/src/app/phorum/static && \
compass compile && \
cd ../.. && \
make collectstatic
WORKDIR "/srv/app"
VOLUME ["/srv/app/media", "/srv/app/protected", "/srv/app/static"]
COPY ./docker-entrypoint.sh /usr/local/bin
ENTRYPOINT ["docker-entrypoint.sh"]