On Wed, Jun 17, 2020 at 7:28 PM Jason Turner <jrturner0...@gmail.com> wrote:

>
> https://testdriven.io/blog/dockerizing-django-with-postgres-gunicorn-and-nginx/
>
> Also, Will Vincent's book "Django for Professionals" is a good resource.
>
> On Wed, Jun 17, 2020, 8:51 AM Anirudh choudhary <
> anirudhchoudary...@gmail.com> wrote:
>
>> I Want to make make a docker image of my Django app using PostgreSQL and
>> unicorn. but I can't find any good tutorial for reference
>> please share my link to if you know any good tutorial
>>
> The first philosophy of docker is to run a single service in a container,
which would translate to you running 2 containers.

   1. Django container having all your Django code
   2. DB container having your DB

Now you can(i would say must) leverage *docker-compose* for local
development. It's somewhat easy to learn, just follow along with the
official docs <https://docs.docker.com/compose>.

> My Dockerfile now is like
>> FROM python:3.6
>> ENV PYTHONUNBUFFERED 1
>> RUN mkdir /app
>> WORKDIR /app
>> COPY requirements.txt /app/requirements.txt
>> RUN pip install -r requirements.txt
>> RUN apt install postgresql-client
>> RUN mkdir postgresqlcode
>> COPY /private_key/client-cert.pem /private_key/client-cert.pem
>> COPY /private_key/client-cert.pem /private_key/client-cert.pem
>> COPY /private_key/client-cert.pem /private_key/client-cert.pem
>> RUN psql "sslmode=verify-ca sslrootcert=\server-ca.pem \
>> sslcert=client-cert.pem sslkey=\client-key.pem \
>> hostaddr=hostaddress \
>> port=port \
>> user=postgres dbname=postgres"
>> COPY . /code/
>>
>>
>> I know I have to make Django-compose.yml file and I ha
>>
>>
>>
>>
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAL8_rkEBoEuAC7N9XCgDsakOVSsGtM1EM_3bZc9azOL3jPhDjw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAL8_rkEBoEuAC7N9XCgDsakOVSsGtM1EM_3bZc9azOL3jPhDjw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CADoyC14A%3Df_c7FGt8RQqacpYKMuQAkj-QmGA49Hmzr08EaorLw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CADoyC14A%3Df_c7FGt8RQqacpYKMuQAkj-QmGA49Hmzr08EaorLw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Thanks,
Mayank Pathak

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD%3DM5eQcWT7OvuU-cGASF8_fLdgfmoxWGxQRU%2BX09gucSBhn_Q%40mail.gmail.com.

Reply via email to