feat: faster builds

This commit is contained in:
Kévin Dunglas
2023-07-31 14:21:06 +02:00
parent 4f299d9f35
commit b2d0b4a21d
10 changed files with 162 additions and 130 deletions

View File

@@ -8,10 +8,10 @@ For instance, use the following command to install Symfony 5.4:
On Linux:
SYMFONY_VERSION=5.4.* docker compose up --build
SYMFONY_VERSION=5.4.* docker compose up --wait
On Windows:
set SYMFONY_VERSION=5.4.*&& docker compose up --build&set SYMFONY_VERSION=
set SYMFONY_VERSION=5.4.*&& docker compose up --wait&set SYMFONY_VERSION=
## Installing Development Versions of Symfony
@@ -22,19 +22,17 @@ For instance, use the following command to use the development branch of Symfony
On Linux:
STABILITY=dev docker compose up --build
STABILITY=dev docker compose up --wait
On Windows:
set STABILITY=dev&& docker compose up --build&set STABILITY=
set STABILITY=dev&& docker compose up --wait&set STABILITY=
## Customizing the Server Name
Use the `SERVER_NAME` environment variable to define your custom server name(s).
SERVER_NAME="app.localhost, caddy:80" docker compose up --build
If you use Mercure, keep `caddy:80` in the list to allow the PHP container to request the caddy service.
SERVER_NAME="app.localhost" docker compose up --wait
*Tips: You can define your server name variable in your `.env` file to keep it at each up*
@@ -42,7 +40,7 @@ If you use Mercure, keep `caddy:80` in the list to allow the PHP container to re
Use the environment variables `HTTP_PORT`, `HTTPS_PORT` and/or `HTTP3_PORT` to adjust the ports to your needs, e.g.
HTTP_PORT=8000 HTTPS_PORT=4443 HTTP3_PORT=4443 docker compose up --build
HTTP_PORT=8000 HTTPS_PORT=4443 HTTP3_PORT=4443 docker compose up --wait
to access your application on [https://localhost:4443](https://localhost:4443).

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 KiB

View File

@@ -31,7 +31,6 @@ ssh root@<droplet-ip>
In most cases, you'll want to associate a domain name to your website.
If you don't own a domain name yet, you'll have to buy one through a registrar.
Use [this affiliate link](https://gandi.link/f/93650337) to redeem a 20% discount at Gandi.net.
Then create a DNS record of type `A` for your domain name pointing to the IP address of your server.
@@ -41,10 +40,6 @@ Example:
your-domain-name.example.com. IN A 207.154.233.113
````
Example in Gandi's UI:
![Creating a DNS record at Gandi.net](gandi-dns.png)
Note: Let's Encrypt, the service used by default by Symfony Docker to automatically generate a TLS certificate doesn't support using bare IP addresses.
Using a domain name is mandatory to use Let's Encrypt.
@@ -66,7 +61,7 @@ Go into the directory containing your project (`<project-name>`), and start the
SERVER_NAME=your-domain-name.example.com \
APP_SECRET=ChangeMe \
CADDY_MERCURE_JWT_SECRET=ChangeThisMercureHubJWTSecretKey \
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
docker compose -f docker-compose.yml -f docker-compose.prod.yml up --wait
```
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.
@@ -82,7 +77,7 @@ Alternatively, if you don't want to expose an HTTPS server but only an HTTP one,
SERVER_NAME=:80 \
APP_SECRET=ChangeMe \
CADDY_MERCURE_JWT_SECRET=ChangeThisMercureHubJWTSecretKey \
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
docker compose -f docker-compose.yml -f docker-compose.prod.yml up --wait
```
## Deploying on Multiple Nodes