-1

I'm new to Docker. I am trying to dockerize a Django app.

My project contains a Wagtail app and I'm using the auto generated Dockerfile by Wagtail.

FROM python:3.8.6-slim-buster

RUN useradd wagtail

EXPOSE 8000

ENV PYTHONUNBUFFERED=1 \
    PORT=8000

RUN apt-get update --yes --quiet && apt-get install --yes --quiet --no-install-recommends \
    build-essential \
    libpq-dev \
    libmariadbclient-dev \
    libjpeg62-turbo-dev \
    zlib1g-dev \
    libwebp-dev \
    nano \
    vim \
 && rm -rf /var/lib/apt/lists/*

RUN pip install "gunicorn==20.0.4"

COPY requirements.txt /

RUN pip install -r /requirements.txt

WORKDIR /app

RUN chown wagtail:wagtail /app

COPY --chown=wagtail:wagtail . .

USER wagtail

RUN python manage.py collectstatic --noinput --clear

CMD set -xe; python manage.py migrate --noinput; gunicorn mysite.wsgi:application

It's working well but my sqlite Database is empty and I'd like to run my container with the wagtail pages that I will create locally.

How can I change the Dockerfile for that endeavor?

Vincent Roye
  • 2,751
  • 7
  • 33
  • 53

1 Answers1

0

Just by dumping and reloading the data in the Docker.

I found out it's pretty bad to use sqlite3 in a Docker container.

I'm better off with that Docker + PostGres solution: https://docs.docker.com/samples/django/

Vincent Roye
  • 2,751
  • 7
  • 33
  • 53