28 lines
877 B
Docker
28 lines
877 B
Docker
# Use an official Python runtime as a parent image
|
|
FROM python:3.9-slim-buster
|
|
|
|
# Set environment variables
|
|
ENV PYTHONDONTWRITEBYTECODE 1
|
|
ENV PYTHONUNBUFFERED 1
|
|
|
|
# Set the working directory in the container
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies that might be needed by psycopg2 or other libraries
|
|
# libpq-dev is for PostgreSQL client libraries
|
|
RUN apt-get update && apt-get install -y \
|
|
libpq-dev \
|
|
gcc \
|
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy the requirements file into the container
|
|
COPY requirements.txt .
|
|
|
|
# Install any needed packages specified in requirements.txt
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy the rest of the application code into the container
|
|
# This will be overridden by the volume mount in docker-compose for development
|
|
COPY . .
|
|
#CMD ["python3", "run.py", "initdb"]
|
|
CMD ["python3", "run.py", "scrape"] |