-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-web
More file actions
94 lines (78 loc) · 2.72 KB
/
Copy pathDockerfile-web
File metadata and controls
94 lines (78 loc) · 2.72 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Note: This only runs the Django app, not the flask services
FROM python:3.6
MAINTAINER Raman Prasad (raman_prasad@harvard.edu)
LABEL organization="PSI" \
2ra.vn.version="0.0.7-beta" \
2ra.vn.release-date="2019-05-22" \
description="Image for the PSI python service which serves the UI."
# -------------------------------------
# Install sqlite + debugging tools
# -------------------------------------
RUN apt-get update && \
apt-get install -y apt-utils \
iputils-ping \
telnet \
vim
# -------------------------------------
# Set the workdir
# -------------------------------------
WORKDIR /var/webapps/PSI
# -------------------------------------
# Copy over the requirements and run them
# -------------------------------------
COPY ./requirements/ ./requirements
RUN pip3 install --upgrade pip && \
pip3 install --no-cache-dir -r requirements/base.txt
# -------------------------------------
# Copy over the rest of the repository
# -------------------------------------
COPY . .
# -------------------------------------
# Set some environment variables
# (This can be overridden in docker compose/kubernetes)
#
# - DJANGO_SETTINGS_MODULE: Django settings
# - FLASK_SVC_URL - flask-service docker container
# - CODE_REPOSITORY - repository where code will be copied
# -------------------------------------
ENV DJANGO_SETTINGS_MODULE=psiproject.settings.local \
FLASK_SERVER_BASE=http://0.0.0.0:8000/ \
FLASK_SVC_URL=/flask-custom/ \
CODE_REPOSITORY=/var/webapps/PSI \
LC_ALL=C.UTF-8
# -------------------------------------
# Create a volume for sharing between containers
# -------------------------------------
VOLUME /psi_volume
# -------------------------------------
# Run setup scripts
# - init_db - creates sqlite db for test run with
#
# - create_django_superuser - Admin user created for testing
#
# X- create_test_user - Non-admin user created for testing
#
# - collect_static - django collect static files
#
# -------------------------------------
RUN fab init-db
# -------------------------------------
# Copy the event data start command
# -------------------------------------
COPY startup_script/psi_start.sh /usr/bin/psi_start.sh
RUN chmod u+x /usr/bin/psi_start.sh
# -------------------------------------
# Expose port for web communication
# - web: 8080
# -------------------------------------
EXPOSE 8080
# -------------------------------------
# Idle the container on startup so it
# can receive subsequent commands
# -------------------------------------
#ENTRYPOINT tail -f /dev/null
#CMD ["python3", "manage.py", "migrate"]
CMD ["python3", "-u", "manage.py", "runserver", "0.0.0.0:8080"]
#RUN cd /var/webapps/PSI && \
# printf "\nStarting web server.." && \
# fab run-web