dockware / examples

Here you can find some usefull dockware examples how to use it the easy way for development.
26 stars 33 forks source link

Report issues related to configurations on running Storefront Watcher #8

Open MinhVu2711 opened 2 months ago

MinhVu2711 commented 2 months ago

https://github.com/dockware/examples/blob/828d1001f091d82bf816b9cd1b2096d802c2ca80/multi-environments/dev/proxy/shop-1.conf#L52

Hi @boxblinkracer, If I put this line in the shop-1.conf the watcher won't work, so I remove that line by following the configuration from the essentials folder instead of dev folder and it works fine.

It would be better if you could update the document on the dockerware website as well ;)

MinhVu2711 commented 2 months ago

btw, may I ask if I change the proxy service port from "80:80" to "8080:80"

version: "3.8"

services:

    proxy:
        container_name: proxy
        image: dockware/proxy:latest
        ports:
            - "80:80"          # Change to "8080:80"
            - "8888:8888"
            - "9999:9999"
            - "9998:9998"
        depends_on:
            - shop1
        volumes:
            - "./proxy/shop-1.conf:/etc/nginx/conf.d/shop-1.conf"

    shop1:
      image: dockware/dev:latest
      container_name: shop1
      ports:
         - "3308:3306"
         - "2222:22"
      volumes:
         - "db_volume:/var/lib/mysql"
         - "shop_volume:/var/www/html"
      environment:
         # default = 0, recommended to be OFF for frontend devs
         - XDEBUG_ENABLED=1
         # default = latest PHP, optional = specific version
         - PHP_VERSION=8.2

....

Then what should I change for the .env and shop-1.conf files as well as the url value from the sales_channel_domain table so that my app can work well?


shop-1.conf:

server {
    listen        80;
    server_name   shop1.shopware.com;

    location / {
        proxy_pass http://shop1;
        proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
    }
}

server {
    listen                    8888 ssl;
    server_name               shop1.shopware.com;

    ssl_certificate /etc/nginx/ssl/selfsigned.crt;
    ssl_certificate_key /etc/nginx/ssl/selfsigned.key;

    location /admin {
        proxy_pass            http://shop1:8888;
        proxy_next_upstream   error timeout invalid_header http_500 http_502 http_503 http_504;
    }
    location /static {
        proxy_pass            http://shop1:8888;
        proxy_next_upstream   error timeout invalid_header http_500 http_502 http_503 http_504;
    }
    location /api {
        proxy_pass            http://shop1;
        proxy_next_upstream   error timeout invalid_header http_500 http_502 http_503 http_504;
    }
    location / {
        proxy_pass            http://shop1:8888;
        proxy_next_upstream   error timeout invalid_header http_500 http_502 http_503 http_504;
    }
}

server {
    listen                    9998;
    server_name               shop1.shopware.com;

    location / {
        proxy_pass            http://shop1:9998;
        proxy_next_upstream   error timeout invalid_header http_500 http_502 http_503 http_504;
    }
}

.env:

###> shopware/storefront ###
STOREFRONT_PROXY_URL=http://localhost
SHOPWARE_HTTP_CACHE_ENABLED=1
SHOPWARE_HTTP_DEFAULT_TTL=7200
###< shopware/storefront ###
APP_ENV=dev
APP_URL=http://shop1.shopware.com
DATABASE_URL=mysql://root:root@127.0.0.1:3306/shopware
MAILER_DSN=smtp://127.0.0.1:1025

/etc/hosts file:

127.0.0.1. shop1.shopware.com