Skip to content

Commit 0faac3a

Browse files
committed
Initial
0 parents  commit 0faac3a

11 files changed

+711
-0
lines changed

.dockerignore

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Git
2+
.git
3+
.gitignore
4+
5+
# Python
6+
__pycache__
7+
*.pyc
8+
*.pyo
9+
*.pyd
10+
.Python
11+
env/
12+
venv/
13+
.env/
14+
.venv/
15+
pip-log.txt
16+
pip-delete-this-directory.txt
17+
.tox/
18+
.coverage
19+
.coverage.*
20+
.cache
21+
nosetests.xml
22+
coverage.xml
23+
*.cover
24+
*.log
25+
26+
# VS Code
27+
.vscode/
28+
29+
# Project specific
30+
*.csv
31+
!myport2.csv # Include our default dataset
32+
*.ipynb
33+
README.md
34+
instructions.md
35+
ref.md
36+
rules.md
37+
38+
# Development files
39+
mvo.py # Exclude MVO development file
40+
hrp.py # Exclude HRP development file

.gitignore

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# Distribution / packaging
7+
dist/
8+
build/
9+
*.egg-info/
10+
11+
# Virtual environments
12+
venv/
13+
env/
14+
.env/
15+
.venv/
16+
ENV/
17+
18+
# IDE specific files
19+
.idea/
20+
.vscode/
21+
*.swp
22+
*.swo
23+
.project
24+
.pydevproject
25+
.settings
26+
27+
# Jupyter Notebook
28+
.ipynb_checkpoints
29+
*.ipynb
30+
31+
# Testing
32+
.pytest_cache/
33+
.coverage
34+
htmlcov/
35+
.tox/
36+
nosetests.xml
37+
coverage.xml
38+
39+
# Logs and databases
40+
*.log
41+
*.sqlite
42+
*.db
43+
44+
# Development files
45+
mvo.py
46+
hrp.py
47+
48+
# OS generated files
49+
.DS_Store
50+
.DS_Store?
51+
._*
52+
.Spotlight-V100
53+
.Trashes
54+
ehthumbs.db
55+
Thumbs.db
56+
57+
# Docker
58+
.docker/
59+
docker-compose.override.yml
60+
61+
# Environment variables
62+
.env
63+
.env.local
64+
.env.*.local
65+
66+
# Data files
67+
*.csv
68+
!myport2.csv # Keep our default dataset
69+
70+
# Documentation
71+
docs/_build/
72+
_build/

Dockerfile

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Use an official Python runtime as a parent image
2+
FROM python:3.9-slim
3+
4+
# Set the working directory in the container
5+
WORKDIR /app
6+
7+
# Copy the current directory contents into the container at /app
8+
COPY . /app
9+
10+
# Install any needed packages specified in requirements.txt
11+
RUN pip install --no-cache-dir -r requirements.txt
12+
13+
# Make ports 8501-8510 available
14+
EXPOSE 8501-8510
15+
16+
# Set environment variable to run streamlit in container
17+
ENV PYTHONPATH=/app
18+
ENV PYTHONUNBUFFERED=1
19+
20+
# Create a startup script
21+
COPY <<EOF /app/start.sh
22+
#!/bin/bash
23+
port=8501
24+
max_port=8510
25+
26+
while [ $port -le $max_port ]; do
27+
if ! lsof -i :$port > /dev/null 2>&1; then
28+
echo "Using port: $port"
29+
exec streamlit run app.py --server.port=$port --server.address=0.0.0.0
30+
break
31+
fi
32+
port=$((port + 1))
33+
done
34+
35+
if [ $port -gt $max_port ]; then
36+
echo "No available ports found in range 8501-8510"
37+
exit 1
38+
fi
39+
EOF
40+
41+
RUN chmod +x /app/start.sh
42+
43+
# Run the startup script
44+
CMD ["/app/start.sh"]

0 commit comments

Comments
 (0)