Debugging staging docker compose server with pycharm

Oleg Belousov

I have the following docker-compose.yml file:

version: '2'
services:
    postgis:
        image: mdillon/postgis
        environment:
           POSTGRES_USER: ${POSTGIS_ENV_POSTGRES_USER}
           POSTGRES_PASSWORD: ${POSTGIS_ENV_POSTGRES_PASSWORD}
           POSTGRES_DB: ${POSTGIS_ENV_POSTGRES_DB}
        volumes:
            - /nexchange/database:/var/lib/postgresql/data
        restart: always
    app:
        image: onitsoft/nexchange:${DOCKER_IMAGE_TAG}
        volumes:
            - /nexchange/mediafiles:/usr/share/nginx/html/media
            - /nexchange/staticfiles:/usr/share/nginx/html/static
        links:
            - postgis
        restart: always
    web:
        image: onitsoft/nginx
        volumes:
            - /nexchange/etc/letsencrypt:/etc/letsencrypt
            - /nexchange/etc/nginx/ssl:/etc/nginx/ssl
            - /nexchange/etc/nginx/nginx.conf:/etc/nginx/nginx.conf
            - /nexchange/mediafiles:/usr/share/nginx/html/media
            - /nexchange/staticfiles:/usr/share/nginx/html/static
        ports:
            - "80:80"
            - "443:443"            
        links:
            - app
        restart: always

For some reason, some functionalities that work on the local container do not work on staging. I would like to configure a remote interpreter in pycharm for staging, however it seems like this setup is not currently supported.

I am using wercker + docker compose and my IDE is pycharm.

EDIT: The question is: How to setup Pycharm debugger to run on a remote host running docker compose

Oleg Belousov

The solution, however not secure, is open the docker API on the remote target to public traffic via iptables (possibly to traffic only from specific IP, if you posses a static IP).

$ ssh [email protected]
oleg@nexchange-staging:~# sudo iptables -A INPUT -p tcp --dport 2376 -j ACCEPT
oleg@nexchange-staging:~# sudo /etc/init.d/iptables restart

And then simply use the docker compose feature of JetBrain PyCharm / PhpStrom or you favourite choice:

enter image description here

Cheers

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

docker-compose integration not working in pycharm

From Dev

Debugging PyCharm?

From Dev

Running/Debugging Pycharm Python Scripts with remote Docker Machine

From Dev

Configure PyCharm interpreter with docker-compose inside Vagrant

From Dev

Configure PyCharm interpreter with docker-compose inside Vagrant

From Java

grpc server not working in docker-compose

From Dev

Django Server wont launch in Docker-Compose

From Dev

Development workflow for server and client using Docker Compose?

From Dev

docker-compose psql could not connect to server

From Dev

docker-compose: django, development server not listening?

From Dev

PyCharm and debugging private attributes

From Dev

Debugging Flask in PyCharm

From Dev

Debugging with PyCharm terminal arguments

From Java

interactive shell debugging with pycharm

From Dev

Debugging inside PyCharm IPython

From Dev

PyCharm: debugging line by line?

From Dev

Debugging Popen subprocesses with PyCharm

From Dev

Building multi-container docker image on server with docker-compose

From Dev

HttpClient not using cache on staging server

From Dev

cookiecutter-django docker PyCharm server config setup

From Dev

How to remove Server list of Docker(Project Interpreter) on Pycharm

From Java

PyCharm: Can't create remote python interpreter using docker-compose

From Dev

"Can't connect to local MySQL server" in docker-compose

From Dev

open iptables whithin docker-compose network and one external server

From Dev

"Can't connect to local MySQL server" in docker-compose

From Dev

Django app server hangs / won't start in Docker Compose

From Dev

docker-compose deployment ensure container is installed on specific server

From Dev

redirect domain www links to www-staging on staging server

From Dev

pyCharm Debugging: skip framework code

Related Related

  1. 1

    docker-compose integration not working in pycharm

  2. 2

    Debugging PyCharm?

  3. 3

    Running/Debugging Pycharm Python Scripts with remote Docker Machine

  4. 4

    Configure PyCharm interpreter with docker-compose inside Vagrant

  5. 5

    Configure PyCharm interpreter with docker-compose inside Vagrant

  6. 6

    grpc server not working in docker-compose

  7. 7

    Django Server wont launch in Docker-Compose

  8. 8

    Development workflow for server and client using Docker Compose?

  9. 9

    docker-compose psql could not connect to server

  10. 10

    docker-compose: django, development server not listening?

  11. 11

    PyCharm and debugging private attributes

  12. 12

    Debugging Flask in PyCharm

  13. 13

    Debugging with PyCharm terminal arguments

  14. 14

    interactive shell debugging with pycharm

  15. 15

    Debugging inside PyCharm IPython

  16. 16

    PyCharm: debugging line by line?

  17. 17

    Debugging Popen subprocesses with PyCharm

  18. 18

    Building multi-container docker image on server with docker-compose

  19. 19

    HttpClient not using cache on staging server

  20. 20

    cookiecutter-django docker PyCharm server config setup

  21. 21

    How to remove Server list of Docker(Project Interpreter) on Pycharm

  22. 22

    PyCharm: Can't create remote python interpreter using docker-compose

  23. 23

    "Can't connect to local MySQL server" in docker-compose

  24. 24

    open iptables whithin docker-compose network and one external server

  25. 25

    "Can't connect to local MySQL server" in docker-compose

  26. 26

    Django app server hangs / won't start in Docker Compose

  27. 27

    docker-compose deployment ensure container is installed on specific server

  28. 28

    redirect domain www links to www-staging on staging server

  29. 29

    pyCharm Debugging: skip framework code

HotTag

Archive