Skip to content

Commit 97a3885

Browse files
authored
update docker-compose docs (#1870)
1 parent c5bee05 commit 97a3885

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

deployment/docker-compose.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ Otherwise, use [this affiliate link](https://m.do.co/c/5d8aabe3ab80) to get $100
1919
Then, click on the "Marketplace" tab under the "Choose an image" section and search for the app named "Docker".
2020
This will provision an Ubuntu server with the latest versions of Docker and Docker Compose already installed!
2121

22-
For test purposes, cheapest plans will be enough, even though you might want at least 2GB of RAM to execute Docker Compose for the first time. For real production usage, you'll probably want to pick a plan in the "general purpose" section that will fit your needs.
22+
For test purposes, the cheapest plans will be enough, even though you might want at least 2GB of RAM to execute Docker Compose for the first time. For real production usage, you'll probably want to pick a plan in the "general purpose" section to fit your needs.
2323

2424
![Deploying an API Platform project on DigitalOcean with Docker Compose](images/digitalocean-droplet.png)
2525

2626
You can keep the defaults for other settings, or tweak them according to your needs.
27-
Don't forget to add your SSH key or to create a password then press the "Finalize and create" button.
27+
Don't forget to add your SSH key or create a password then press the "Finalize and create" button.
2828

2929
Then, wait a few seconds while your Droplet is provisioning.
3030
When your Droplet is ready, use SSH to connect:
@@ -35,23 +35,26 @@ ssh root@<droplet-ip>
3535

3636
## Configuring a Domain Name
3737

38-
In most cases, you'll want to associate a domain name to your website.
38+
In most cases, you'll want to associate a domain name with your site.
3939
If you don't own a domain name yet, you'll have to buy one through a registrar.
4040

41-
Then create a DNS record of type `A` for your domain name pointing to the IP address of your server.
42-
43-
Example:
41+
Then create a DNS record of type `A` for your domain name pointing to the IP address of your server:
4442

4543
```dns
4644
your-domain-name.example.com. IN A 207.154.233.113
47-
````
45+
```
46+
47+
Example with the DigitalOcean Domains service ("Networking" > "Domains"):
4848

49-
Note: Let's Encrypt, the service used by default by API Platform to automatically generate a TLS certificate, doesn't support using bare IP addresses.
50-
Using a domain name is mandatory to use Let's Encrypt.
49+
![Configuring DNS on DigitalOcean](digitalocean-dns.png)
50+
51+
> [!NOTE]
52+
> Let's Encrypt, the service used by default by API Platform to automatically generate a TLS certificate, doesn't support using bare IP addresses.
53+
> Using a domain name is mandatory to use Let's Encrypt.
5154
5255
## Deploying
5356

54-
Copy your project on the server using `git clone`, `scp` or any other tool that may fit your needs.
57+
Copy your project on the server using `git clone`, `scp`, or any other tool that may fit your needs.
5558
If you use GitHub, you may want to use [a deploy key](https://docs.github.com/en/developers/overview/managing-deploy-keys#deploy-keys).
5659
Deploy keys are also [supported by GitLab](https://docs.gitlab.com/ee/user/project/deploy_keys/).
5760

@@ -71,11 +74,17 @@ CADDY_MERCURE_JWT_SECRET=ChangeThisMercureHubJWTSecretKey \
7174
docker compose -f compose.yaml -f compose.prod.yaml up --wait
7275
```
7376

74-
Be sure to replace `your-domain-name.example.com` by your actual domain name and to set the values of `APP_SECRET`, `CADDY_MERCURE_JWT_SECRET` to cryptographically secure random values.
77+
Be sure to replace `your-domain-name.example.com` with your actual domain name and to set the values of `APP_SECRET`, `CADDY_MERCURE_JWT_SECRET` to cryptographically secure random values.
78+
79+
> [!CAUTION]
80+
> Docker can have a cache layer, make sure you have the right build for each deployment or rebuild your project with --no-cache option to avoid cache issue.
7581
7682
Your server is up and running, and a Let's Encrypt HTTPS certificate has been automatically generated for you.
7783
Go to `https://your-domain-name.example.com` and enjoy!
7884

85+
> [!NOTE]
86+
> The worker mode of FrankenPHP is enabled by default in prod. To disable it, add the env var FRANKENPHP_CONFIG as empty to the compose.prod.yaml file.
87+
7988
## Disabling HTTPS
8089

8190
Alternatively, if you don't want to expose an HTTPS server but only an HTTP one, run the following command:
126 KB
Loading
-89 KB
Loading

0 commit comments

Comments
 (0)