-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
60 lines (46 loc) · 1.65 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
58
59
FROM httpd:alpine
# Install Python3 and pip3
# This hack is widely applied to avoid python printing issues in docker containers.
# See: https://github.com/Docker-Hub-frolvlad/docker-alpine-python3/pull/13
ENV PYTHONUNBUFFERED=1
# set current directory in container, will be created if it doesn't exist
WORKDIR /central
# use HTTP instead of HTTPS
# there seems to be some issues with Windows security certificates
RUN sed -i 's/https/http/' /etc/apk/repositories
# installing dependencies
RUN echo "*** install bash ***" && \
apk update && \
apk add --no-cache bash
RUN echo "**** install Python ****" && \
apk update && \
apk add --no-cache python3 && \
echo "**** install pip ****" && \
apk add --no-cache py3-pip && \
rm /usr/lib/python*/EXTERNALLY-MANAGED && \
pip3 install --no-cache --upgrade pip setuptools wheel
RUN echo "installing Flask and gunicorn" && \
pip install Flask && \
pip install requests && \
pip install -U flask-cors && \
pip install gunicorn && \
mkdir /central/API && \
mkdir /central/UI && \
mkdir /central/apacheconfig
# copying over source code
COPY API /central/API
COPY UI /usr/local/apache2/htdocs/
# needed for Flask app
ENV FLASK_APP=api.py
# copying file for setting up environment variables
COPY set_env.py /central/API
# copying over shell script
COPY start.sh /central/API
# sets file permissions as executable
RUN chmod +x /central/API/start.sh
# copying over Apache configuration files
COPY apache_main.conf /central/apacheconfig
COPY apache_main_ssl.conf /central/apacheconfig
COPY apache_ssl.conf /central/apacheconfig
WORKDIR /central/API
CMD ["/central/API/start.sh"]