Files
old-saburly-wagtail-web/Dockerfile

33 lines
776 B
Docker
Raw Normal View History

2024-08-27 20:33:44 +02:00
FROM python:3.8.1-slim-buster
2024-08-27 20:58:41 +02:00
ENV PYTHONUNBUFFERED=1
2024-08-27 20:33:44 +02:00
2024-08-27 20:58:41 +02:00
# Install system dependencies
RUN apt-get update --yes && apt-get install --yes --no-install-recommends \
2024-08-27 20:33:44 +02:00
build-essential \
libpq-dev \
libjpeg62-turbo-dev \
zlib1g-dev \
libwebp-dev \
2024-08-27 20:58:41 +02:00
gettext \
2024-08-27 20:33:44 +02:00
&& rm -rf /var/lib/apt/lists/*
2024-08-27 20:58:41 +02:00
# Add and set up the working directory
WORKDIR /app
2024-08-27 20:33:44 +02:00
2024-08-27 20:58:41 +02:00
# Copy requirements file and install dependencies
COPY requirements.txt /app/
RUN pip install --upgrade pip \
&& pip install -r /app/requirements.txt
2024-08-27 20:33:44 +02:00
2024-08-27 20:58:41 +02:00
# Copy application code
COPY . /app/
2024-08-27 20:33:44 +02:00
# Collect static files
RUN python manage.py collectstatic --noinput --clear
2024-08-27 20:58:41 +02:00
# Expose the port the app runs on
2024-08-27 20:33:44 +02:00
EXPOSE 8000
2024-08-27 20:58:41 +02:00
# Run the application server
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "saburly.wsgi:application"]