|
| 1 | +# syntax=docker/dockerfile:experimental |
1 | 2 | FROM python:3.6
|
2 | 3 |
|
3 |
| -RUN apt-get update \ |
4 |
| - && apt-get install -y --no-install-recommends \ |
| 4 | +EXPOSE 80 |
| 5 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 6 | + libsasl2-dev libldap2-dev libssl-dev \ |
| 7 | + nginx supervisor \ |
5 | 8 | && rm -rf /var/lib/apt/lists/*
|
| 9 | +RUN mkdir ~/.ssh && echo "Host git*\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config |
| 10 | +RUN echo 'TLS_REQCERT allow' >> /etc/ldap/ldap.conf |
| 11 | + |
| 12 | +RUN echo "daemon off;" >> /etc/nginx/nginx.conf |
| 13 | +COPY etc/nginx.conf /etc/nginx/sites-available/default |
| 14 | +COPY etc/supervisor.conf /etc/supervisor/conf.d/app.conf |
6 | 15 |
|
7 | 16 | WORKDIR /usr/src/app
|
8 | 17 | COPY requirements.txt ./
|
9 |
| -RUN pip3 install -r requirements.txt |
10 |
| -COPY . . |
11 | 18 |
|
12 |
| -RUN python3 ./manage.py initial_setup |
13 |
| -RUN python3 ./manage.py load_test_data |
| 19 | +ARG IFXURLS_COMMIT=549af42dbe83d07b12dd37055a5ec6368d4b649 |
| 20 | +ARG NANITES_CLIENT_COMMIT=a11ff96ccb2c888d0d07ac97f27de1153463bf59 |
| 21 | +ARG IFXUSER_COMMIT=8832f49c218375eb1a2f0a4a4488d33fd76ccbb6 |
| 22 | +ARG FIINE_CLIENT_COMMIT=b944730dcdf7de9df3479efdeb48848813a14032 |
| 23 | +ARG IFXBILLING_COMMIT=89382408913ac3a3292493dbcf5fbde1573be120 |
| 24 | + |
| 25 | +RUN --mount=type=ssh pip install --upgrade pip && \ |
| 26 | + pip install 'Django>2.2,<3' && \ |
| 27 | + pip install django-author==1.0.2 && \ |
| 28 | + pip install git+ssh:// [email protected]/harvardinformatics/ifxurls.git@${IFXURLS_COMMIT} && \ |
| 29 | + pip install git+ssh:// [email protected]/harvardinformatics/nanites.client.git@${NANITES_CLIENT_COMMIT} && \ |
| 30 | + pip install git+ssh:// [email protected]/harvardinformatics/ifxuser.git@${IFXUSER_COMMIT} && \ |
| 31 | + pip install git+ssh:// [email protected]/informatics/fiine.client.git@${FIINE_CLIENT_COMMIT} && \ |
| 32 | + pip install git+ssh:// [email protected]/informatics/ifxbilling.git@${IFXBILLING_COMMIT} && \ |
| 33 | + pip install ldap3 django_auth_ldap && \ |
| 34 | + pip install -r requirements.txt |
| 35 | + |
| 36 | +COPY . . |
14 | 37 |
|
15 |
| -ENV DEBUG=True |
| 38 | +CMD ./manage.py collectstatic --no-input && ./manage.py makemigrations && ./manage.py migrate && /usr/bin/supervisord -n |
16 | 39 |
|
17 |
| -EXPOSE 8000 |
18 |
| -CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] |
|
0 commit comments