# Base image FROM python:3.9-slim # Set environment variables to prevent Python from generating .pyc files ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 # Install git and any required system dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ git \ && rm -rf /var/lib/apt/lists/* # Set the working directory WORKDIR /app RUN mkdir -p translations/ && chmod -R 777 translations/ RUN chown -R $(whoami):$(whoami) translations/ # Clone the repository into a specific folder RUN git clone https://github.com/ramonvc/freegpt-webui.git freegpt # Change working directory to the cloned repository WORKDIR /app/freegpt # Remove problematic package from requirements.txt RUN sed -i '/mailgw_temporary_email/d' requirements.txt # Install Python dependencies RUN pip3 install --no-cache-dir -r requirements.txt # Compile translations RUN pybabel compile -d translations # Expose the port that the application will run on EXPOSE 5000 # Command to run the application CMD ["python", "run.py"]