-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
64 lines (45 loc) · 1.45 KB
/
Dockerfile
File metadata and controls
64 lines (45 loc) · 1.45 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
FROM ubuntu:18.04
ARG APP_ENV
ENV APP_ENV ${APP_ENV}
ENV FLASK_ENV ${APP_ENV}
ARG ODOO_URL
ARG ODOO_USERNAME
ARG ODOO_PASSWORD
ARG ODOO_DATABASE
ENV ODOO_URL ${ODOO_URL}
ENV ODOO_USERNAME ${ODOO_USERNAME}
ENV ODOO_PASSWORD ${ODOO_PASSWORD}
ENV ODOO_DATABASE ${ODOO_DATABASE}
# install python 3.7
RUN apt update && apt install -y software-properties-common curl && \
add-apt-repository -y ppa:deadsnakes/ppa && \
apt install -y python3.7 && python3.7 --version && apt install -y python3-pip && \
python3.7 -m pip install pip
# install nginx web server
RUN apt update && \
apt install -y nginx && \
rm /etc/nginx/sites-available/default && \
rm /etc/nginx/sites-enabled/default
# set working directory
WORKDIR /home/root
# set shell to bash
SHELL ["/bin/bash", "-c"]
# copy dependencies and create virtual environment with them installed
COPY ./requirements.txt ./requirements.txt
RUN pip3 install virtualenv --upgrade && \
virtualenv -p /usr/bin/python3.7 venv && \
source venv/bin/activate && \
pip install -r requirements.txt && \
pip install gunicorn
COPY ./app.py ./app.py
COPY ./src ./src
# copy docker settings
COPY ./docker ./docker
# converting file from ms to unix format otherwise will fail on windows
RUN apt update && apt-get install -y dos2unix
RUN dos2unix docker/scripts/start.sh
RUN dos2unix docker/nginx/default
# make start up script executable
RUN chmod 777 docker/scripts/start.sh
ENTRYPOINT [ "/bin/bash", "docker/scripts/start.sh"]
EXPOSE 80