My personal Cloud Development environment
My personal Cloud Development environment for developing Shopware with NoMachine
Over the years I have tested many ways to do that. Here all my tested tools so far
Github Code Spaces
Coder (Selfhosted VSCode in Browser)
Projector (Jetbrain IDE in Browser)
XServer Forwarding
Okteto
Desktop inside Container with VNC, TeamViewer, AnyDesk access
Desktop with NoMachine inside Container (this repository)
This repository contains my NoMachine configuration.
.env.dist
to .env
and change the passworddocker-compose.yml.dist
to docker-compose.yml
and adjust the content if necessarydocker-compose up -d
<server-ip>:4000
with user dev
and your given passwordnix-env -iA nixpkgs.nano
)We have two docker containers:
I usally use only PhpStorm inside NoMachine and use my normal browser outside. To archive this we need on the Host an Reverse Proxy like nginx/traefik which redirects the dini container.
Your Local Browser -> Nginx/Traefik/Other-Proxy -> DINI Container -> SWDC with the Shop
Variables:
172.18.0.4
: Is the IP of the Docker Container (docker inspect --format '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' cloud-dev_docker_1
)shy.ovh
: My dev domain replace it with yours/root/.acme.sh/*.shy.ovh/
contains my wildcard letsencrypt certificate for shy.ovh
domain/etc/nginx/firewall.conf
contains an simple ip allow and deny list. You should always have an IP Whitelist active. When you have an changing IP generate that file often and reload the nginx serverserver {
listen 80;
listen [::]:80;
server_name *.shy.ovh;
proxy_buffering off;
ignore_invalid_headers off;
client_max_body_size 0;
gzip on;
include /etc/nginx/firewall.conf;
location / {
proxy_pass http://172.18.0.4:80;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect http:// $scheme://;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name *.shy.ovh;
proxy_buffering off;
ssl_certificate /root/.acme.sh/*.shy.ovh/fullchain.cer;
ssl_certificate_key /root/.acme.sh/*.shy.ovh/*.shy.ovh.key;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
ssl_protocols TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5:!SHA1:!kRSA;
ssl_prefer_server_ciphers off;
ignore_invalid_headers off;
client_max_body_size 0;
gzip on;
location ~* ^.+\.(?:css|cur|js|jpe?g|gif|ico|png|svg|webp|html)$ {
expires 1y;
add_header Cache-Control "public";
proxy_pass http://172.18.0.4:80;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect http:// $scheme://;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
}
include /etc/nginx/firewall.conf;
location / {
proxy_pass http://172.18.0.4:80;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect http:// $scheme://;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
}
}
Variables:
shy.ovh
: Replace it with your Domainhttp:
middlewares:
home-check:
ipWhiteList:
sourceRange:
- "127.0.0.1/32"
labels:
- traefik.enable=true
- traefik.http.routers.http-phpstorm-docker.entrypoints=web
- traefik.http.routers.http-phpstorm-docker.rule=HostRegexp(`{subdomain:.+}.shy.ovh`)
- traefik.http.routers.http-phpstorm-docker.middlewares=home-check@file
- traefik.http.routers.http-phpstorm-docker.priority=1
- traefik.http.routers.phpstorm-docker.entrypoints=websecure
- traefik.http.routers.phpstorm-docker.rule=HostRegexp(`{subdomain:.+}.shy.ovh`)
- traefik.http.routers.phpstorm-docker.tls=true
- traefik.http.routers.phpstorm-docker.middlewares=home-check@file
- traefik.http.routers.phpstorm-docker.tls.certresolver=hetzner
- traefik.http.routers.phpstorm-docker.tls.domains[0].main=shy.ovh
- traefik.http.routers.phpstorm-docker.tls.domains[0].sans=*.shy.ovh
- traefik.http.routers.phpstorm-docker.priority=1
swdc up
vi .config/swdc/env
DEFAULT_DOMAIN
and DEFAULT_SERVICES_DOMAIN
to your wildcard domain (e.g shy.ovh
)swdc up
~/Code/
or create a new one with swdc create-project <name>
swdc up
<folder-name>.<domain>
(e.g sw6.shy.ovh
)For the usage of the Shopware-Docker see in https://github.com/shyim/shopware-docker