This is a Django authentication system fully containerized using Docker. It provides user registration, login, logout, and authentication management using Django's built-in authentication system. The application is designed to be deployable and scalable with ease using PostgreSQL as the database.
- User Authentication (Register, Login, Logout)
- Django Admin Panel
- PostgreSQL Integration
- Dockerized for Easy Deployment
- Backend: Django
- Database: PostgreSQL 14
- Containerization: Docker & Docker Compose
- Python3
- Django
- Docker
- Docker compose
-
CLone the Repo
git clone https://github.com/alexander784/django_auth-with-docker.git -
Build and Run the conatiners
docker-compose up --build -d -
Apply migrations
docker-compose exec web python manage.py migrate -
Access the App
- Web App: http://127.0.0.1:8000
├── auth
│ ├── settings.py
│ ├── urls.py
│ ├── wsgi.py
│ ├── asgi.py
├── ruhusa/
│ ├── models.py
│ ├── views.py
│ ├── urls.py
├── templates/
├── docker-compose.yml
├── Dockerfile
├── requirements.txt
├── manage.py
FROM python:3.10
WORKDIR /code
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
version: '3.10.12'
services:
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- db
db:
image: postgres:14
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- postgres_data:/var/lib/postgresql/data/
volumes:
postgres_data:
sudo docker-compose up -d -Start the containers.
sudo docker-compose down- Stop and remove containers
docker-compose exec web python manage.py migrate - Apply MIgrations
docker-compose logs -f View container log
This project is licensed under the MIT License. See LICENSE for details.