-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
40 lines (25 loc) · 963 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
40
FROM python:3.9
# This Dockerfile manually installs cg-django-uaa from a built
# distribution and sets up the example app to run. It can be used
# to verify that everything about the packaging of cg-django-uaa is
# working properly (e.g., that important data files aren't being left
# out of the built distribution).
ARG version
ARG django_version
RUN pip install django==${django_version}
COPY requirements-tests.txt /
RUN pip install -r /requirements-tests.txt
COPY dist/cg-django-uaa-${version}.tar.gz /
WORKDIR /
RUN pip install cg-django-uaa-${version}.tar.gz && \
python -m uaa_client.runtests
COPY example /example
# Remove existing database from local testing, if any,
# otherwise superuser creation below will fail
RUN rm /example/db.sqlite3
WORKDIR /example
RUN python manage.py migrate && \
python manage.py createsuperuser --noinput \
--username foo --email foo@example.org
EXPOSE 8000
CMD python manage.py runserver 0.0.0.0:8000