podcraft_web_app / Dockerfile
Nagesh Muralidhar
added static
2251ba3
raw
history blame
1.24 kB
FROM python:3.11-slim
WORKDIR /app
# Install ffmpeg and other dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ffmpeg \
build-essential \
nodejs \
npm \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Copy the application code
COPY . .
# Make sure static directory exists and has the index.html file
RUN mkdir -p ./static && \
if [ ! -f "./static/index.html" ]; then \
echo "WARNING: No index.html found in static directory"; \
else \
echo "Found index.html in static directory"; \
fi
# Create directories for temp files
RUN mkdir -p temp_audio temp
# Execute the build frontend script to prepare frontend code
RUN chmod +x build_frontend.sh && ./build_frontend.sh || echo "Frontend build script failed but continuing"
# Install backend dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Verify the static files
RUN ls -la ./static && \
if [ -f "./static/index.html" ]; then echo "Frontend index.html found"; else echo "WARNING: Frontend index.html not found"; fi
# Default environment variables
ENV PORT=7860
ENV HOST=0.0.0.0
# Expose the port
EXPOSE 7860
# Command to run the application
CMD ["python", "app.py"]