Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/akmamun/django-nginx-docker

Dockerizing Django with Postgres, Gunicorn, and Nginx
https://github.com/akmamun/django-nginx-docker

devlopment devops django docker docker-compose docker-deployment gunicorn nginx postgresql python

Last synced: 28 days ago
JSON representation

Dockerizing Django with Postgres, Gunicorn, and Nginx

Awesome Lists containing this project

README

        

# Dockerizing Django with Postgres, Gunicorn, and Nginx
## Instruction for Docker Deployment

## Installation

Requirements:
- Docker Latest

Follow these steps:

- Make a file name `.env`
- In`.env` file change `SQL_HOST="db"` or `DB_HOST="db"`
- Make a file name `.env.docker` add for postgres
```sh
POSTGRES_USER=postgres
POSTGRES_PASSWORD=giveapassword
POSTGRES_DB=postgres
```

## Up and Run

- Docker Build
```sh
docker-compose up -d --build
```
- Lets Browse [http://0.0.0.0:8080](http://0.0.0.0:8080)
- Migration
```sh
docker-compose exec server python manage.py migrate --noinput
```
- Collect Statics
```sh
docker-compose exec server python manage.py collectstatic --no-input --clear
```
- Check Logs
```sh
docker-compose logs -f
```
- Container down
```sh
docker-compose down
```