![]() ![]() For that open the settings ( File > Settings on windows, P圜harm > preferences on Mac OS) and open the python interpreter section in your project.Ĭlick on the three dots on the right then add We will configure Pycharm to use our docker as a python interpreter. We can fix that in the terminal but let's configure Pycharm and do it through the IDE. Now everything is ready but if you run your docker compose you will have an error because the database is empty. 'ENGINE': 'django.db.backends.postgresql', We will as well make some modification on our settings file (my_blog/ settings.py): ĪLLOWED_HOSTS = #to allow access in local The object is not about dockerizing an application but how to configure Pycharm. Same than for the Dockerfile you probably understand this file. Image: "postgres:latest" container_name: MyDb At the root of the project, create a file docker-compose.yml: version: '3' services: Setup the docker compose fileĪs we will have two dockers to run together, we will need docker-compose to manage them. For PostgreSQL, we don't need a Dockerfile, the official image will be enough for us. This Dockerfile will create the docker which will run our python interpreter. I suppose you understand this file as we explained it in the tutorial about deployment. RUN pip install -upgrade pip COPY requirements.txt /app/requirements.txtĬMD ![]() RUN apk update
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |