Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add docker variant for 6.7 #159

Merged
merged 1 commit into from
Feb 18, 2025
Merged

chore: add docker variant for 6.7 #159

merged 1 commit into from
Feb 18, 2025

Conversation

shyim
Copy link
Member

@shyim shyim commented Feb 18, 2025

No description provided.

Copy link

Thanks for the PR 😍

How to test these changes in your application

  1. Add the Shopware flex endpoint in your composer.json to https://raw.githubusercontent.com/shopware/recipes/flex/pull-159/index.json.

    # When jq is installed
    jq '.extra.symfony.endpoint |= [ "https://raw.githubusercontent.com/shopware/recipes/flex/pull-159/index.json" ] + .' composer.json > composer.tmp && mv composer.tmp composer.json

    or manually

    "endpoint": [
        "https://raw.githubusercontent.com/shopware/recipes/flex/pull-159/index.json",
        "https://raw.githubusercontent.com/shopware/recipes/flex/main/index.json",
        "flex://defaults"
    ]
  2. Install the package(s) related to this recipe:

    composer req 'shopware/docker:^0.3'

Diff between recipe versions

In order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes.
I'm going keep this comment up to date with any updates of the attached patch.

shopware/docker

0.1 vs 0.2
diff --git a/shopware/docker/0.1/config/packages/docker.yaml b/shopware/docker/0.2/config/packages/docker.yaml
index 7fa7809..b64bd8f 100644
--- a/shopware/docker/0.1/config/packages/docker.yaml
+++ b/shopware/docker/0.2/config/packages/docker.yaml
@@ -1,12 +1,7 @@
-parameters:
-    env(JWT_PRIVATE_KEY): ""
-    env(JWT_PUBLIC_KEY): ""
-
 shopware:
     api:                                                                                                               
         jwt_key:                                                                                                       
-            private_key_path: '%env(base64:JWT_PRIVATE_KEY)%'                                                          
-            public_key_path: '%env(base64:JWT_PUBLIC_KEY)%'
+            use_app_secret: true
     auto_update:
         enabled: false
     store:
@@ -22,24 +17,3 @@ shopware:
             type: 'array'
         message_queue:
             type: 'array'
-
-when@prod:
-    monolog:
-        handlers:
-            main:
-                type: fingers_crossed
-                action_level: error
-                handler: nested
-                excluded_http_codes: [404, 405]
-                buffer_size: 50 # How many messages should be saved? Prevent memory leaks
-            nested:
-                type: stream
-                path: php://stderr
-                level: error
-                formatter: monolog.formatter.json
-            console:
-                type: console
-                process_psr_3_messages: false
-                channels: ["!event", "!doctrine"]
-            business_event_handler_buffer:
-                level: error
diff --git a/shopware/docker/0.2/config/packages/prod/monolog.yaml b/shopware/docker/0.2/config/packages/prod/monolog.yaml
new file mode 100644
index 0000000..50eb719
--- /dev/null
+++ b/shopware/docker/0.2/config/packages/prod/monolog.yaml
@@ -0,0 +1,19 @@
+monolog:
+    handlers:
+        main:
+            type: fingers_crossed
+            action_level: error
+            handler: nested
+            excluded_http_codes: [404, 405]
+            buffer_size: 50
+        nested:
+            type: stream
+            path: php://stderr
+            level: error
+            formatter: monolog.formatter.json
+        console:
+            type: console
+            process_psr_3_messages: false
+            channels: ["!event", "!doctrine"]
+        business_event_handler_buffer:
+            level: error
diff --git a/shopware/docker/0.1/docker/Dockerfile b/shopware/docker/0.2/docker/Dockerfile
index 29b0296..37a68fc 100644
--- a/shopware/docker/0.1/docker/Dockerfile
+++ b/shopware/docker/0.2/docker/Dockerfile
@@ -1,8 +1,8 @@
 #syntax=docker/dockerfile:1.4
 
 # pin versions
-FROM shopware/docker-base:8.2 AS base-image
-FROM shopware/shopware-cli:latest-php-8.2 AS shopware-cli
+FROM shopware/docker-base:8.3 AS base-image
+FROM shopware/shopware-cli:latest-php-8.3 AS shopware-cli
 
 # build
 
@@ -22,4 +22,4 @@ RUN --mount=type=secret,id=composer_auth,dst=/src/auth.json \
 
 FROM base-image
 
-COPY --from=build --chown=www-data --link /src /var/www/html
+COPY --from=build --chown=82 --link /src /var/www/html
diff --git a/shopware/docker/0.1/post-install.txt b/shopware/docker/0.2/post-install.txt
index a81e722..172a0a9 100644
--- a/shopware/docker/0.1/post-install.txt
+++ b/shopware/docker/0.2/post-install.txt
@@ -1,5 +1,5 @@
   * Setup
     This recipe has created a docker/Dockerfile with an example file to build a Shopware Docker image.
     You can build it with docker build -t <name> -f docker/Dockerfile ..
-    Make sure you run `./bin/console system:generate-jwt-secret --use-env` and added the private and public key to the environment file, otherwise the Administration won't work anymore.
+    Make sure you to set a correct `APP_SECRET`, you can generate one with `openssl rand -hex 128`
     See https://github.com/shopware/docker for the complete documentation to configure things.
0.2 vs 0.3
diff --git a/shopware/docker/0.2/config/packages/docker.yaml b/shopware/docker/0.3/config/packages/docker.yaml
index b64bd8f..0baa6ef 100644
--- a/shopware/docker/0.2/config/packages/docker.yaml
+++ b/shopware/docker/0.3/config/packages/docker.yaml
@@ -1,7 +1,4 @@
 shopware:
-    api:                                                                                                               
-        jwt_key:                                                                                                       
-            use_app_secret: true
     auto_update:
         enabled: false
     store:
@@ -14,6 +11,6 @@ shopware:
         update_mail_variables_on_send: false
     increment:
         user_activity:
-            type: 'array'
+            type: "array"
         message_queue:
-            type: 'array'
+            type: "array"
diff --git a/shopware/docker/0.2/config/packages/trusted_env.yaml b/shopware/docker/0.2/config/packages/trusted_env.yaml
deleted file mode 100644
index 036d155..0000000
--- a/shopware/docker/0.2/config/packages/trusted_env.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-parameters:
-    env(TRUSTED_PROXIES): ''
-
-framework:
-    trusted_proxies: '%env(TRUSTED_PROXIES)%'
diff --git a/shopware/docker/0.2/docker/Dockerfile b/shopware/docker/0.3/docker/Dockerfile
index 37a68fc..ae2d76a 100644
--- a/shopware/docker/0.2/docker/Dockerfile
+++ b/shopware/docker/0.3/docker/Dockerfile
@@ -1,7 +1,7 @@
 #syntax=docker/dockerfile:1.4
 
 # pin versions
-FROM shopware/docker-base:8.3 AS base-image
+FROM shopware/docker-base:8.4 AS base-image
 FROM shopware/shopware-cli:latest-php-8.3 AS shopware-cli
 
 # build

@shyim shyim merged commit da18450 into main Feb 18, 2025
1 of 2 checks passed
@shyim shyim deleted the add-docker-recipe-for-6.7 branch February 18, 2025 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant