+7
-3
@@ -17,7 +17,8 @@ COPY data/ data/
|
|||||||
RUN mkdir -p data/icons && chmod 755 data && chmod 755 data/icons && chmod +x data/servctl.sh
|
RUN mkdir -p data/icons && chmod 755 data && chmod 755 data/icons && chmod +x data/servctl.sh
|
||||||
|
|
||||||
# Create startup script
|
# Create startup script
|
||||||
RUN echo '#!/bin/bash
|
RUN cat > /app/startup.sh << 'EOF'
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
# Check if database file exists
|
# Check if database file exists
|
||||||
if [ ! -f "/app/data/dashboard.db" ]; then
|
if [ ! -f "/app/data/dashboard.db" ]; then
|
||||||
@@ -33,14 +34,17 @@ fi
|
|||||||
# Check if servctl.sh exists in data directory
|
# Check if servctl.sh exists in data directory
|
||||||
if [ ! -f "/app/data/servctl.sh" ]; then
|
if [ ! -f "/app/data/servctl.sh" ]; then
|
||||||
echo "Copying servctl.sh to data directory..."
|
echo "Copying servctl.sh to data directory..."
|
||||||
cp /app/servctl.sh /app/data/
|
cp /app/data/servctl.sh /app/data/
|
||||||
chmod +x /app/data/servctl.sh
|
chmod +x /app/data/servctl.sh
|
||||||
echo "servctl.sh copied successfully"
|
echo "servctl.sh copied successfully"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Start the application
|
# Start the application
|
||||||
echo "Starting Servboard..."
|
echo "Starting Servboard..."
|
||||||
python app.py' > /app/startup.sh && chmod +x /app/startup.sh
|
python app.py
|
||||||
|
EOF
|
||||||
|
|
||||||
|
RUN chmod +x /app/startup.sh
|
||||||
|
|
||||||
# Expose port
|
# Expose port
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
|
|||||||
Reference in New Issue
Block a user