updated whit entrypoint

This commit is contained in:
2025-05-28 21:08:09 +03:00
parent 87a9c77ee0
commit 2e94a334de
3 changed files with 19 additions and 7 deletions

View File

@@ -15,6 +15,10 @@ RUN rustc --version && cargo --version
# Copy application files
COPY . /app
# Copy entrypoint script and make it executable
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Upgrade pip and install Python dependencies (using piwheels for ARM)
RUN python -m pip install --upgrade pip && \
pip install --no-cache-dir --extra-index-url https://www.piwheels.org/simple -r requirements.txt
@@ -22,5 +26,5 @@ RUN python -m pip install --upgrade pip && \
# Expose the application port
EXPOSE 5000
# Start the application
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:5000", "app:app"]
# Use entrypoint script
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -1,10 +1,8 @@
version: '3.8'
services:
web:
image: digi-server:latest
image: digiserver:latest
ports:
- "80:5000"
- "8880:5000"
environment:
- FLASK_APP=app.py
- FLASK_RUN_HOST=0.0.0.0
@@ -14,5 +12,4 @@ services:
volumes:
- /home/pi/Desktop/digi-server/db:/app/instance
- /home/pi/Desktop/digi-server/static:/app/static/uploads
command: gunicorn -w 4 -b 0.0.0.0:5000 app:app
restart: unless-stopped

11
entrypoint.sh Normal file
View File

@@ -0,0 +1,11 @@
#!/bin/sh
# filepath: /home/ske087/digiserver/entrypoint.sh
# Initialize the database if it doesn't exist
if [ ! -f "/app/instance/dashboard.db" ]; then
echo "Initializing database..."
python init_db.py
fi
# Start Gunicorn
exec gunicorn -w 4 -b 0.0.0.0:5000 app:app