-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (26 loc) · 1.05 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
# please change :
# password.txt with your desire filename
# password_admin with your desire password admin
# 8000 with your available port
# TODO: Usare LTS
FROM ubuntu:latest
ARG BACKENDAPP=istsos
ARG user=py4web
ARG password=test
RUN apt update && apt install -y git python3 python3-pip memcached python3-psycopg2
RUN service memcached restart
RUN groupadd -r $user && useradd -m -r -g $user $user
# RUN groupadd -g 1000 -r $user && useradd -m -u 1000 -g 1000 -r $user
RUN python3 -m pip install -U py4web ujson
USER $user
RUN cd /home/$user/ && mkdir apps && touch apps/__init__.py
# py4web setup --yes apps
# TODO: con una cartella condivisa potrebbe non essere necessario copiare la repo
COPY . /home/$user/apps/$BACKENDAPP
COPY ./requirements.txt /home/$user/
RUN python3 -m pip install -U -r /home/$user/requirements.txt
RUN cd /home/$user/ && \
if [ $password=="none" ]; then echo "no admin"; else py4web set_password < "$password"; fi
EXPOSE 8000
WORKDIR /home/$user/
CMD py4web run --password_file password.txt --host 0.0.0.0 --port 8000 apps