Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion guides/hosting/infrastructure/reverse-http-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,17 @@ If you look for the old documentation and examples, you can find it [here](https

::: info
Since Shopware 6.6, the `TRUSTED_PROXIES` environment variable is no longer taken into account out of the box.
Make sure to create a Symfony configuration to make it configurable again, as shown in the [trusted_env.yaml example](https://github.com/shopware/recipes/blob/main/shopware/docker/0.1/config/packages/trusted_env.yaml).
Create `config/packages/trusted_env.yaml` to make it configurable again:
:::

```yaml
parameters:
env(TRUSTED_PROXIES): ''

framework:
trusted_proxies: '%env(TRUSTED_PROXIES)%'
```

For the most part, using Symfony and Varnish doesn't cause any problem.
But when a request passes through a proxy, certain request information is sent using either the *standard Forwarded* header or *X-Forwarded* headers.
For example, instead of reading the `REMOTE_ADDR` header (which will now be the IP address of your reverse proxy), the user's true IP will be stored in a standard Forwarded: for="..." header or an *X-Forwarded-For* header.
Expand Down
45 changes: 36 additions & 9 deletions guides/hosting/installation-updates/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,21 @@
Shopware provides a Docker image to run Shopware 6 in a containerized environment for production intent. The Docker image is based on the official PHP image and includes the required PHP extensions and configurations to run Shopware 6. But it does not contain Shopware itself.
It's intended to be used together with your existing Shopware project, copy the project into the image, build it, and run it.

If you don't have a Shopware project yet, you can create a new one with:
If you don't have a Shopware project yet, create one with [Shopware CLI](../../../products/tools/cli/index.md):

::: info
You can create a Project with a specific Shopware version by specifying the version like: `composer create-project shopware/production:6.6.7.0 <folder>`
You can create a project with a specific Shopware version by specifying the version like: `shopware-cli project create <folder> 6.6.7.0`
:::

```bash
composer create-project shopware/production <folder>
shopware-cli project create <folder>
cd <folder>
composer require shopware/docker
```

Alternatively, you can run the CLI without a separate installation via:

```bash
npx @shopware-ag/shopware-cli project create <folder>
```

The typical Dockerfile in your project would look like this:
Expand Down Expand Up @@ -53,10 +58,6 @@

The Dockerfile uses the `shopware-cli` image to build the project and then copies the built project into the `base-image` image. The `base-image` is the Shopware Docker image.

::: info
Instead of copying the Dockerfile to your project, rather run `composer req shopware/docker` to add the Dockerfile to your project. This keeps the Dockerfile up-to-date with the latest changes using Symfony Flex recipes.
:::

## Available Tags / Versioning

::: info
Expand Down Expand Up @@ -127,7 +128,33 @@
| image thumbnails | `/var/www/html/public/thumbnail` |
| generated sitemap | `/var/www/html/public/sitemap` |

Shopware logs by default to `var/log`, but when `shopware/docker` Composer package is installed, we change it to stdout. This means you can use `docker logs` to see the logs or use logging driver to forward the logs to a logging service.
Shopware logs by default to `var/log`. In Docker, configure Monolog to write to stderr so you can use `docker logs` or a logging driver to forward the logs to a logging service.

Create `config/packages/prod/monolog.yaml`:

```yaml
parameters:
env(MONOLOG_LOG_LEVEL): "error"
monolog:
handlers:
main:
type: fingers_crossed
action_level: "%env(MONOLOG_LOG_LEVEL)%"
handler: nested
excluded_http_codes: [404, 405]
buffer_size: 50
nested:
type: stream
path: php://stderr

Check warning on line 148 in guides/hosting/installation-updates/docker.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] guides/hosting/installation-updates/docker.md#L148

File types are normally capitalized. (FILE_EXTENSIONS_CASE[1]) Suggestions: `PHP` URL: https://languagetool.org/insights/post/spelling-capital-letters/ Rule: https://community.languagetool.org/rule/show/FILE_EXTENSIONS_CASE?lang=en-US&subId=1 Category: CASING
Raw output
guides/hosting/installation-updates/docker.md:148:18: File types are normally capitalized. (FILE_EXTENSIONS_CASE[1])
 Suggestions: `PHP`
 URL: https://languagetool.org/insights/post/spelling-capital-letters/ 
 Rule: https://community.languagetool.org/rule/show/FILE_EXTENSIONS_CASE?lang=en-US&subId=1
 Category: CASING
level: "%env(MONOLOG_LOG_LEVEL)%"
formatter: monolog.formatter.json
console:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine"]

Check warning on line 154 in guides/hosting/installation-updates/docker.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] guides/hosting/installation-updates/docker.md#L154

Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES) URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US Category: PUNCTUATION
Raw output
guides/hosting/installation-updates/docker.md:154:30: Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
 URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses 
 Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
 Category: PUNCTUATION
business_event_handler_buffer:
level: "%env(MONOLOG_LOG_LEVEL)%"
```

## Ideal Setup

Expand Down
Loading