30 lines
727 B
Docker
30 lines
727 B
Docker
FROM python:3.8.1-slim-buster
|
|
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
RUN apt-get update --yes && apt-get install --yes --no-install-recommends \
|
|
build-essential \
|
|
libpq-dev \
|
|
libjpeg62-turbo-dev \
|
|
zlib1g-dev \
|
|
libwebp-dev \
|
|
gettext \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
COPY requirements.txt /app/
|
|
RUN pip install --upgrade pip \
|
|
&& pip install -r /app/requirements.txt
|
|
|
|
COPY . /app/
|
|
|
|
RUN python manage.py collectstatic --noinput --clear
|
|
RUN python manage.py makemigrations
|
|
RUN python manage.py migrate
|
|
RUN python manage.py createsuperuser --username "admin" --email "admin@example.com" --password "mysecretpassword"
|
|
|
|
EXPOSE 8000
|
|
|
|
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "saburly.wsgi:application"]
|