32 lines
822 B
Docker
32 lines
822 B
Docker
# Use an official Python runtime as a parent image
|
|
FROM python:3.10
|
|
|
|
# Set environment variables
|
|
ENV PYTHONDONTWRITEBYTECODE 1
|
|
ENV PYTHONUNBUFFERED 1
|
|
ENV DEBUG=${DEBUG}
|
|
|
|
# Set the working directory in the container
|
|
WORKDIR /app
|
|
|
|
# Copy the current directory contents into the container at /app
|
|
COPY . /app
|
|
|
|
# Install any needed packages specified in requirements.txt
|
|
RUN pip install --upgrade pip
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
RUN python manage.py collectstatic --noinput
|
|
|
|
# Copy the startup script
|
|
COPY start.sh /app/
|
|
RUN chmod +x /app/start.sh
|
|
|
|
# Make port 8000 available to the world outside this container
|
|
EXPOSE 8000
|
|
|
|
# Define environment variable
|
|
ENV NAME World
|
|
|
|
# Run manage.py when the container launches
|
|
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
|