I have a django project right now that allows users to login and register an account. Sort of like a blog. All the views are separated and have their own static html file. The project works running locally and all.
Users data is currently running with the default sqlite3 database
currently i am able to put the whole project into a single docker container and it works when I run it.
I use commands:
docker compose up –build
I am trying to separate my docker project into multiple docker containers.
I want separate containers for the frontend and backend.
a lot of tutorials online show how to have multiple containers using only postgressql, but I couldn’t find much on sqlite3(django default database). I want to be able to do this with a sqlite3. Is this a way to do this.
I have a requirements file, .dockerignore, Dockerfile, and a docker-compose.yml file.
Any help would be appreciated.
docker-compose.yml:
eversion: "3"
services:
django:
image: django-docker:0.0.1
build: .
ports:
- "8000:8000"```
Dockerfile:
FROM python:3.12.3
ENV PYTHONUNBUFFER=1
WORKDIR /code
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 8000
CMD ["python", "manage.py","runserver"]
user124e is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1