Skip to content

Commit b8d95bc

Browse files
author
Ronan
committed
feat: add docker-compose
1 parent 9f785b8 commit b8d95bc

File tree

4 files changed

+196
-0
lines changed

4 files changed

+196
-0
lines changed

Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Your Python version
2+
FROM python:3.10 as taipy
3+
4+
# Web port of the application
5+
EXPOSE 5000
6+
7+
# Create taipy user for security
8+
RUN groupadd -r taipy && useradd -r -m -g taipy taipy
9+
USER taipy
10+
11+
# Go to the dedicated folder and add the python corresponding folder in PATH
12+
WORKDIR /home/taipy
13+
ENV PATH="${PATH}:/home/taipy/.local/bin"
14+
15+
# Update pip and install Gunicorn with a suitable worker
16+
RUN python -m pip install --upgrade pip
17+
RUN python -m pip install gunicorn gevent-websocket
18+
19+
# Install your application
20+
COPY app/ .
21+
RUN python -m pip install -r requirements.txt
22+
23+
# Start up command
24+
CMD [ "gunicorn", "-k", "geventwebsocket.gunicorn.workers.GeventWebSocketWorker", "-w", "1", "--bind=0.0.0.0:5000", "--timeout", "1800", "--module", "main:web_app " ]
25+
#CMD [ "main:run" ]

docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
taipy:
3+
build: .
4+
nginx:
5+
image: nginx:1.23
6+
ports:
7+
- "5000:8080"
8+
volumes:
9+
- ./nginx.conf:/etc/nginx/nginx.conf

nginx.conf

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Copyright 2023 Avaiga Private Limited
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
4+
# the License. You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
9+
# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
10+
# specific language governing permissions and limitations under the License.
11+
12+
13+
user nginx;
14+
worker_processes auto;
15+
error_log /var/log/nginx/error.log;
16+
pid /run/nginx.pid;
17+
18+
include /usr/share/nginx/modules/*.conf;
19+
20+
events {
21+
worker_connections 1024;
22+
}
23+
24+
http {
25+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
26+
'$status $body_bytes_sent "$http_referer" '
27+
'"$http_user_agent" "$http_x_forwarded_for"';
28+
29+
access_log /var/log/nginx/access.log main;
30+
31+
sendfile on;
32+
tcp_nopush on;
33+
tcp_nodelay on;
34+
keepalive_timeout 65;
35+
types_hash_max_size 2048;
36+
37+
include /etc/nginx/mime.types;
38+
default_type application/octet-stream;
39+
40+
include /etc/nginx/conf.d/*.conf;
41+
42+
server {
43+
listen 80 default_server;
44+
listen [::]:80 default_server;
45+
server_name _;
46+
root /usr/share/nginx/html;
47+
48+
include /etc/nginx/default.d/*.conf;
49+
50+
location / {
51+
proxy_pass http://taipy:5000;
52+
proxy_set_header Upgrade $http_upgrade;
53+
proxy_set_header Host $host;
54+
}
55+
56+
error_page 404 /404.html;
57+
location = /40x.html {
58+
}
59+
60+
error_page 500 502 503 504 /50x.html;
61+
location = /50x.html {
62+
}
63+
}
64+
}

requirements.txt

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
aniso8601==9.0.1 ; python_version >= "3.10" and python_version < "4.0"
2+
apispec-webframeworks==1.0.0 ; python_version >= "3.10" and python_version < "4.0"
3+
apispec[yaml]==6.4.0 ; python_version >= "3.10" and python_version < "4.0"
4+
arrow==1.3.0 ; python_version >= "3.10" and python_version < "4.0"
5+
attrs==23.2.0 ; python_version >= "3.10" and python_version < "4.0"
6+
automat==22.10.0 ; python_version >= "3.10" and python_version < "4.0"
7+
bidict==0.23.1 ; python_version >= "3.10" and python_version < "4.0"
8+
binaryornot==0.4.4 ; python_version >= "3.10" and python_version < "4.0"
9+
blinker==1.8.2 ; python_version >= "3.10" and python_version < "4.0"
10+
boto3==1.34.34 ; python_version >= "3.10" and python_version < "4.0"
11+
botocore==1.34.111 ; python_version >= "3.10" and python_version < "4.0"
12+
certifi==2024.2.2 ; python_version >= "3.10" and python_version < "4.0"
13+
cffi==1.16.0 ; platform_python_implementation == "CPython" and sys_platform == "win32" and python_version >= "3.10" and python_version < "4.0"
14+
chardet==5.2.0 ; python_version >= "3.10" and python_version < "4.0"
15+
charset-normalizer==3.3.2 ; python_version >= "3.10" and python_version < "4.0"
16+
click==8.1.7 ; python_version >= "3.10" and python_version < "4.0"
17+
colorama==0.4.6 ; python_version >= "3.10" and python_version < "4.0" and platform_system == "Windows"
18+
constantly==23.10.4 ; python_version >= "3.10" and python_version < "4.0"
19+
contourpy==1.2.1 ; python_version >= "3.10" and python_version < "4.0"
20+
cookiecutter==2.5.0 ; python_version >= "3.10" and python_version < "4.0"
21+
cycler==0.12.1 ; python_version >= "3.10" and python_version < "4.0"
22+
deepdiff==6.7.1 ; python_version >= "3.10" and python_version < "4.0"
23+
dnspython==2.6.1 ; python_version >= "3.10" and python_version < "4.0"
24+
et-xmlfile==1.1.0 ; python_version >= "3.10" and python_version < "4.0"
25+
flask-cors==4.0.0 ; python_version >= "3.10" and python_version < "4.0"
26+
flask-restful==0.3.10 ; python_version >= "3.10" and python_version < "4.0"
27+
flask-socketio==5.3.6 ; python_version >= "3.10" and python_version < "4.0"
28+
flask==3.0.2 ; python_version >= "3.10" and python_version < "4.0"
29+
fonttools==4.51.0 ; python_version >= "3.10" and python_version < "4.0"
30+
gevent-websocket==0.10.1 ; python_version >= "3.10" and python_version < "4.0"
31+
gevent==23.9.1 ; python_version >= "3.10" and python_version < "4.0"
32+
gitignore-parser==0.1.11 ; python_version >= "3.10" and python_version < "4.0"
33+
greenlet==3.0.3 ; python_version >= "3.10" and python_version < "4.0" and (platform_python_implementation == "CPython" or platform_machine == "aarch64" or platform_machine == "ppc64le" or platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "AMD64" or platform_machine == "win32" or platform_machine == "WIN32")
34+
h11==0.14.0 ; python_version >= "3.10" and python_version < "4.0"
35+
humanize==4.9.0 ; python_version >= "3.10" and python_version < "4.0"
36+
hyperlink==21.0.0 ; python_version >= "3.10" and python_version < "4.0"
37+
idna==3.7 ; python_version >= "3.10" and python_version < "4.0"
38+
incremental==22.10.0 ; python_version >= "3.10" and python_version < "4.0"
39+
itsdangerous==2.2.0 ; python_version >= "3.10" and python_version < "4.0"
40+
jinja2==3.1.4 ; python_version >= "3.10" and python_version < "4.0"
41+
jmespath==1.0.1 ; python_version >= "3.10" and python_version < "4.0"
42+
kiwisolver==1.4.5 ; python_version >= "3.10" and python_version < "4.0"
43+
kthread==0.2.3 ; python_version >= "3.10" and python_version < "4.0"
44+
markdown-it-py==3.0.0 ; python_version >= "3.10" and python_version < "4.0"
45+
markdown==3.5.2 ; python_version >= "3.10" and python_version < "4.0"
46+
markupsafe==2.1.5 ; python_version >= "3.10" and python_version < "4.0"
47+
marshmallow==3.20.2 ; python_version >= "3.10" and python_version < "4.0"
48+
matplotlib==3.9.0 ; python_version >= "3.10" and python_version < "4.0"
49+
mdurl==0.1.2 ; python_version >= "3.10" and python_version < "4.0"
50+
networkx==3.2.1 ; python_version >= "3.10" and python_version < "4.0"
51+
numpy==1.26.4 ; python_version >= "3.10" and python_version < "4.0"
52+
openpyxl==3.1.2 ; python_version >= "3.10" and python_version < "4.0"
53+
ordered-set==4.1.0 ; python_version >= "3.10" and python_version < "4.0"
54+
packaging==24.0 ; python_version >= "3.10" and python_version < "4.0"
55+
pandas==2.2.0 ; python_version >= "3.10" and python_version < "4.0"
56+
passlib==1.7.4 ; python_version >= "3.10" and python_version < "4.0"
57+
pillow==10.3.0 ; python_version >= "3.10" and python_version < "4.0"
58+
plotly==5.22.0 ; python_version >= "3.10" and python_version < "4.0"
59+
pyarrow==15.0.0 ; python_version >= "3.10" and python_version < "4.0"
60+
pycparser==2.22 ; platform_python_implementation == "CPython" and sys_platform == "win32" and python_version >= "3.10" and python_version < "4.0"
61+
pygments==2.18.0 ; python_version >= "3.10" and python_version < "4.0"
62+
pymongo[srv]==4.6.1 ; python_version >= "3.10" and python_version < "4.0"
63+
pyparsing==3.1.2 ; python_version >= "3.10" and python_version < "4.0"
64+
python-dateutil==2.9.0.post0 ; python_version >= "3.10" and python_version < "4.0"
65+
python-dotenv==1.0.1 ; python_version >= "3.10" and python_version < "4.0"
66+
python-engineio==4.9.1 ; python_version >= "3.10" and python_version < "4.0"
67+
python-slugify==8.0.4 ; python_version >= "3.10" and python_version < "4.0"
68+
python-socketio==5.11.2 ; python_version >= "3.10" and python_version < "4.0"
69+
pytz==2023.3.post1 ; python_version >= "3.10" and python_version < "4.0"
70+
pyyaml==6.0.1 ; python_version >= "3.10" and python_version < "4.0"
71+
requests==2.32.2 ; python_version >= "3.10" and python_version < "4.0"
72+
rich==13.7.1 ; python_version >= "3.10" and python_version < "4.0"
73+
s3transfer==0.10.1 ; python_version >= "3.10" and python_version < "4.0"
74+
setuptools==70.0.0 ; python_version >= "3.10" and python_version < "4.0"
75+
simple-websocket==1.0.0 ; python_version >= "3.10" and python_version < "4.0"
76+
six==1.16.0 ; python_version >= "3.10" and python_version < "4.0"
77+
sqlalchemy==2.0.25 ; python_version >= "3.10" and python_version < "4.0"
78+
taipy-config==3.1.1 ; python_version >= "3.10" and python_version < "4.0"
79+
taipy-core==3.1.1 ; python_version >= "3.10" and python_version < "4.0"
80+
taipy-gui==3.1.2 ; python_version >= "3.10" and python_version < "4.0"
81+
taipy-rest==3.1.1 ; python_version >= "3.10" and python_version < "4.0"
82+
taipy-templates==3.1.1 ; python_version >= "3.10" and python_version < "4.0"
83+
taipy==3.1.1 ; python_version >= "3.10" and python_version < "4.0"
84+
tenacity==8.3.0 ; python_version >= "3.10" and python_version < "4.0"
85+
text-unidecode==1.3 ; python_version >= "3.10" and python_version < "4.0"
86+
toml==0.10.2 ; python_version >= "3.10" and python_version < "4.0"
87+
twisted-iocpsupport==1.0.4 ; python_version >= "3.10" and python_version < "4.0" and platform_system == "Windows"
88+
twisted==23.10.0 ; python_version >= "3.10" and python_version < "4.0"
89+
types-python-dateutil==2.9.0.20240316 ; python_version >= "3.10" and python_version < "4.0"
90+
typing-extensions==4.11.0 ; python_version >= "3.10" and python_version < "4.0"
91+
tzdata==2024.1 ; python_version >= "3.10" and python_version < "4.0"
92+
tzlocal==5.2 ; python_version >= "3.10" and python_version < "4.0"
93+
urllib3==2.2.1 ; python_version >= "3.10" and python_version < "4.0"
94+
werkzeug==3.0.3 ; python_version >= "3.10" and python_version < "4.0"
95+
wordcloud==1.9.3 ; python_version >= "3.10" and python_version < "4.0"
96+
wsproto==1.2.0 ; python_version >= "3.10" and python_version < "4.0"
97+
zope-event==5.0 ; python_version >= "3.10" and python_version < "4.0"
98+
zope-interface==6.4.post1 ; python_version >= "3.10" and python_version < "4.0"

0 commit comments

Comments
 (0)