Public | Automated Build

Last pushed: 2 months ago
Short Description
PHPStorm container
Full Description

Example usage:

Environment

PUID

PUID must be set and equal to your current UserID. Your current UID can be found with echo $(id -u)

PGID

PGID must be set and equal to your current GroupID. Your current GID can be found with echo $(id -g)

docker-compose

version: '3'

services:
    phpstorm:
        image: sm0ke0ut/phpstorm
        volumes:
        - "/path/to/projects:/workspace"
        - "./config:/settings"
        - "~/.gitconfig:/home/phpstorm/.gitconfig"
        #- "~/.gnupg:/home/phpstorm/.gnupg" # enable this if you want to enable PGP signing (https://github.com/blog/2144-gpg-signature-verification)
        - "/tmp/.X11-unix:/tmp/.X11-unix" # x11 display sharing
        - "$SSH_AUTH_SOCK:/ssh-agent" # ssh-agent forwarding
        #- "/var/run/docker.sock:/var/run/docker.sock" # enable this if you want to have docker support for accessing your application container(s)
        ports:
        - "9000"    # xdebug
        - "9001"    # DBGp proxy
        - "10137"   # zend debugger
        - "20080"   # zend broadcast
        working_dir: /workspace
        environment:
        - DISPLAY=$DISPLAY # x11 display sharing
        - SSH_AUTH_SOCK=/ssh-agent # ssh-agent forwarding
        - PUID=1000 # your current uid
        - PGID=1000 # your current gid
        - DOCKER_HOST=unix:///var/run/docker.sock

Remote interpreter

If you define the DOCKER_HOST env and mount /var/run/docker.sock you'll be able to setup a remote interpreter through the PHPStorm Docker API.

For ease of setup I would recommend to keep the project dir the same on host and container. e.g.

volumes:
- /home/user/Projects:/home/user/Projects
Docker Pull Command
Owner
sm0ke0ut
Source Repository

Comments (0)