| # Use the official Python image | |
| FROM python:3.10-slim | |
| # Set the working directory in the container | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| libpq-dev \ | |
| curl \ | |
| docker.io \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install Docker Compose | |
| RUN curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \ | |
| && chmod +x /usr/local/bin/docker-compose | |
| # Copy the current directory contents into the container at /app | |
| COPY . /app | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Expose port 80 to the outside world | |
| EXPOSE 80 | |
| # Define environment variables | |
| ENV NAME Dify | |
| # Run the application | |
| CMD ["docker-compose", "up"] | |