-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
50 lines (36 loc) · 1.45 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
# @Copyright VSETH - Verband der Studierenden an der ETH Zürich
# @Author Thore Goebel <[email protected]>
#
# Dockerfile for the tq-website
FROM eu.gcr.io/vseth-public/base:foxtrott
# Copy cinit file
COPY cinit.yml /etc/cinit.d/tq-website.yml
# Run apt update
RUN apt update -y
# Install python
RUN apt install -y python3 python3-pip python3-setuptools
# Install dependencies:
# - git to clone code from Github
# - libpq-dev to build psycopg2 (which in turn is needed for the connection to postgres)
# - gettext to generate translations
# - pkg-config & libcairo2-dev are needed for building reportlab
RUN apt install -y --no-install-recommends git libpq-dev gettext pkg-config libcairo2-dev
RUN mkdir -p /app
WORKDIR /app
# Copy the code into the container
COPY . .
# Ensure the scripts are executable
RUN chmod +x scripts/generate_env_sip.sh && chmod +x scripts/pre-start.sh && chmod +x scripts/generate_env.py && chmod +x scripts/post-start.sh
# Install requirements
RUN python3 -m pip install --upgrade pip --break-system-packages
RUN python3 -m pip install -r requirements.txt --break-system-packages
# Make sure log directory and files exist
RUN mkdir -p logs && \
touch logs/django.log && \
touch logs/tq.log && \
touch logs/payments.log && \
touch logs/errors.log
RUN mkdir -p ~/.aws
RUN echo "[default]\nregion=europe-west-2" > ~/.aws/config
# Change permissions on the code so the app-user can access it
RUN chown -R app-user:app-user .