Service Name for Docker Compose Remote Interpreter in PyCharm 5.1 Beta 2

I imported into PyCharm 5.1 Beta 2 a training project that works great when I run it from the command line using docker layout: https://docs.docker.com/compose/django/

Trying to install a remote python interpreter is causing problems.

I'm trying to figure out what the service name field expects: the remote interpreter is the docker socket window - http://i.stack.imgur.com/Vah7P.png .

My docker-compose.yml file:

version: '2' services: db: image: postgres web: build: . command: python manage.py runserver 0.0.0.0:8000 volumes: - .:/code ports: - "8000:8000" depends_on: - db 

When I try to enter a website or db or anything at all that comes to mind, I get an error: It is assumed that the service definition will be a map

So what should I go in there?

EDIT1 (new version: Pycharm 2016.1 release)

Now I am updated to the latest version and I am still having problems:. IOError: [Errno 21] Is the directory

Sorry for not tagging all links - there is a new limit for user links

+5
source share
1 answer

The only viable way we discovered for this (Pycharm 2016.1) is to set up a remote SSH interpreter.

Add this to the main Dockerfile service:

 RUN apt-get install -y openssh-server RUN mkdir /var/run/sshd RUN echo 'root:screencast' | chpasswd RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config # SSH login fix. Otherwise user is kicked off after login RUN sed ' s@session \s*required\s* pam_loginuid.so@session optional pam_loginuid.so@g ' -i /etc/pam.d/sshd ENV NOTVISIBLE "in users profile" RUN echo "export VISIBLE=now" >> /etc/profile EXPOSE 22 CMD ["/usr/sbin/sshd", "-D"] 

Then go to the docker container this way (in the sample screencast code example):

 $ ssh root@192.168.99.100 -p 2000 

Note. We know that IP and port may vary depending on your docker and configuration

For PyCharm, a remote SSH interpreter is just configured, and you're done!

https://www.jetbrains.com/help/pycharm/2016.1/configuring-remote-interpreters-via-ssh.html

+1
source

Source: https://habr.com/ru/post/1245497/


All Articles