-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
70 lines (47 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
60
61
62
63
64
65
66
67
68
69
70
#downloading the base image alpine
FROM ubuntu:18.04
RUN groupadd docker
RUN useradd edukauser
RUN usermod -a -G docker edukauser
# install python3 and pip3 then upgrade the pop so
RUN apt-get update -y && \
apt-get install -y python-pip python-dev
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
tzdata \
&& rm -rf /var/lib/apt/lists/*
## To install pgcog2 for postgres
RUN apt-get update -y && \
apt-get install -y python3-psycopg2
## To install Pillow we need to install the following
RUN apt-get install -y libtiff5-dev libjpeg8-dev zlib1g-dev \
libfreetype6-dev liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev \
tcl8.6-dev tk8.6-dev python-tk \
&& rm -rf /var/lib/apt/lists/*
# copy the source code of the flask app: eduka
# create a app folder inside the docker image
WORKDIR /app
# we will be able to install the softwares in requirements.txt
COPY requirements.txt requirements.txt
RUN apt-get update -y && \
apt-get install -y python3-venv
RUN python3 -m venv venv
# install the softwares in the requirements.txt
# in the image
RUN venv/bin/pip install -r requirements.txt
RUN venv/bin/pip install gunicorn
# copy the source code from the app on the computer
# to the app folder in the image
COPY eduka eduka
COPY migrations migrations
COPY app.py boot.sh ./
RUN chmod +x boot.sh
ENV FLASK_APP app.py
RUN chown -R edukauser:edukauser ./
USER edukauser
# expose the following port to access the app
# from outside the image
EXPOSE 5000
# make the entry point for the image
ENTRYPOINT ["./boot.sh"]
# the file that need to run first
# for the app to start