Coder Social home page Coder Social logo

amerkurev / django-docker-template Goto Github PK

View Code? Open in Web Editor NEW
157.0 157.0 30.0 688 KB

Dockerized Django with Postgres, Gunicorn, and Traefik or Caddy (with auto renew Let's Encrypt)

Home Page: https://django-docker.dev

License: MIT License

Dockerfile 7.95% Shell 4.77% Python 80.79% CSS 0.11% HTML 6.38%
caddy django django-application django-framework django-learning django-project docker docker-compose gunicorn letsencrypt traefik

django-docker-template's Introduction

Hi there ๐Ÿ‘‹

I'm a Python Developer and the creator of the website python.study, as well as some interesting Python projects.

I also write articles about Python on Medium.

My recent posts:

In addition, I have a rich experience in C++ development from the past, and I dabble a bit in Go as well.

And when the need arises, and there's no one else to help, I can also write in JavaScript, although my main focus is backend development.

GitHub stats

Top Langs

django-docker-template's People

Contributors

amerkurev avatar angvp avatar dependabot[bot] avatar shariq1989 avatar ydamni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

django-docker-template's Issues

Traefik dashboard

Is the dashboard enabled in dev/prod? If so how can it be accessed?

Env file for prod

Hi! I appreciate you putting this together and publishing it. I am going to prod with a new site using this. I typically use env files in local and prod that are not checked in to git. I prevent this by adding all .en* files to gitignore. How are you handling secrets? I wish your project was a little more opinionated on this. If I overwrite the settings in .env, i would have to handle them not getting updated when I pull changes into prod. If I create a new .env-prod file that is not checked in to git, I would have to update references to the existing .env file with something like "if SETTINGS.DEBUG use .env else use .env-prod". Am I missing something?

SQL Choice Conflict in Readme

"The technology stack used includes:

[....]
PostgreSQL ver. 15
[...]"

and

"Another important point is the use of SQLite3 instead of Postgres (which we don't run). In our example, we add a volume named sqlite. This data is stored persistently and does not disappear between restarts of the Django development server. However, if you have a second similar project, it would be better to change the volume name from sqlite to something else so that the second project uses its own copy of the database. For example:"

It's very likely that I'm simply missing something here but these seems to be an editing mistake.

Permission Issues When Running Docker Containers

I encountered two permission issues while running containers with Docker on Fedora 38. Here are the details of the problems and the solutions I applied:

1- Issue with permission to access docker.sock

When I ran the following command:

docker compose -f docker-compose.debug.yml up

I encountered the following error:

"msg="Failed to retrieve information of the docker client and server host: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock"

To resolve this, I added privileged: true to the reverse-proxy YAML configuration in the docker-compose.debug.yml file.

2- Issue with permission to access source files in development container
When I ran the following command:

docker run -it --rm -p 8000:8000 -v sqlite:/sqlite -v $(pwd)/website:/website django-docker-template:master python manage.py runserver 0.0.0.0:8000

I encountered the following error:

"python: can't open file '/usr/src/website/manage.py': [Errno 13] Permission denied"

To resolve this, I had to change /usr/src/website to /usr/src/website:z everywhere in the YAML files and the command.

Environment:

  • Fedora 38
  • Docker 20.10.23
  • docker-compose 1.29.2.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.