-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Updating docker-compose for production #1333
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
Conversation
deployment/docker-compose.md
Outdated
@@ -12,21 +12,10 @@ e.g. [Docker Hub](https://hub.docker.com/), [Google Container Registry](https:// | |||
would pull the pre-built images from the container registry. This maintains a separation of concerns between the build | |||
environment and the production environment. | |||
|
|||
## Installing the Docker Compose Setup for Production | |||
## Deploying for production for ApiPlatorm 2.6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API Platform
I had a lot of struggle myself to figure out how it works on v. 2.6. So i hope this will be reviewed shortly and will help a lot of users for a better start to API-Platform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo fix
deployment/docker-compose.md
Outdated
If you are using the [API Platform Distribution](../distribution/index.md), we provide a [ready-to-deploy Docker Compose | ||
setup for production](https://github.com/api-platform/docker-compose-prod), with (optional) [Let's Encrypt](https://letsencrypt.org/) | ||
integration. | ||
Thanks to ApiPlatform 2.6, the deploiement process has never been so easy. The required docker-compose files are already there, and you just have to pass the docker-compose.prod.yml to docker-compose to build images for production. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deploiement -> deployment
deployment/docker-compose.md
Outdated
@@ -12,21 +12,10 @@ e.g. [Docker Hub](https://hub.docker.com/), [Google Container Registry](https:// | |||
would pull the pre-built images from the container registry. This maintains a separation of concerns between the build | |||
environment and the production environment. | |||
|
|||
## Installing the Docker Compose Setup for Production | |||
## Deploying for production for ApiPlatorm 2.6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Deploying for production for ApiPlatorm 2.6 | |
## Deploying for Production |
deployment/docker-compose.md
Outdated
If you are using the [API Platform Distribution](../distribution/index.md), we provide a [ready-to-deploy Docker Compose | ||
setup for production](https://github.com/api-platform/docker-compose-prod), with (optional) [Let's Encrypt](https://letsencrypt.org/) | ||
integration. | ||
Thanks to ApiPlatform 2.6, the deploiement process has never been so easy. The required docker-compose files are already there, and you just have to pass the docker-compose.prod.yml to docker-compose to build images for production. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks to ApiPlatform 2.6, the deploiement process has never been so easy. The required docker-compose files are already there, and you just have to pass the docker-compose.prod.yml to docker-compose to build images for production. | |
To build images for production, you have to use the `docker-compose.prod.yml` file with Docker Compose. |
deployment/docker-compose.md
Outdated
|
||
If you are **not** using the (optional) Let's Encrypt integration: | ||
Let's Encrypt integration is now automatic, thanks to Caddy Server: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this comment.
TRUSTED_HOSTS=^(?:localhost|api|api\.example\.com)$ | ||
VARNISH_IMAGE=registry.example.com/api-platform/varnish | ||
MERCURE_PUBLISHER_JWT_KEY=someKey | ||
MERCURE_SUBSCRIBER_JWT_KEY=someKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be worth to mention, that you need also update docker-compose.yml
file database section to use bind volume. Otherwise you are at risk to override all your production data.
Also environment variable SERVER_NAME
set in docker compose.yml
may be different in production.
Thinking if documentation is the place to inform to change these, or API-Platform 2.6 docker-compose needs more work to be production ready. Like moving DB volume setting and some variables (POSTGRES_PASSWORD
) to environment or to .override
and .prod
respectively.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello,
I think that the Docker Compose configuration needs some work for the database indeed to be usable in production.
Are you willing to make a PR?
Thank you! |
Hi,
Here is an updated version of the documentation for ApiPlatform 2.6, current one is reflecting ApiPlatform 2.5. I struggled a bit to deploy in production, and finally came across that so I think that would be good for future users.
I think there are environment variables missing, I needed only those ones and didn't have time to make further testing. So be free to add those you know !