This commit was merged in pull request #345.
This commit is contained in:
@@ -549,27 +549,34 @@ route requests after. You're free to make as many `$whatever.yml` files in your
|
||||
typically configurable when not using `FILE_PROVIDER_DIRECTORY_ENABLED`.
|
||||
|
||||
## Using Traefik for docker-(swarm)-deployment without recipe
|
||||
If you prefer to integrate your apps without recipe directly in docker swarm, you can do this by setting the respective traefik-labels and deploy your app using `docker stack deploy -c compose.yml example_com` (make sure of course, the STACK_NAME: example_com is not used by another abra-app).
|
||||
|
||||
Example:
|
||||
If you prefer to integrate your apps without recipe directly in docker swarm, you can do this by setting the respective traefik-labels in your `compose`-file and deploy your app using `docker stack deploy -c compose.yml example_com` (make sure of course, the STACK_NAME: `example_com` is not used by another abra-app).
|
||||
|
||||
1. create a `.env` yourself with the needed env-vars
|
||||
Theoretically you are free to choose whatever stack-name you want, just make sure it's. The default in recipe's is to use the (sub-)domain of the app deployed, replacing dots `.` by underscores `_`. (`yourapp.example.com` -> STACK_NAME: `yourapp_example_com`,
|
||||
|
||||
### _Example:_
|
||||
|
||||
#### 1. on your server create a `.env` yourself with the needed env-vars
|
||||
|
||||
```
|
||||
DOMAIN=example.com
|
||||
EXTRA_DOMAINS=', `www.example.com`'
|
||||
LETS_ENCRYPT_ENV=production
|
||||
|
||||
# the .env-vars needed in your compose-file
|
||||
# ... the .env-vars needed in your compose-file
|
||||
```
|
||||
|
||||
2. source this .env-file
|
||||
#### 2. source this .env-file
|
||||
```
|
||||
set -a
|
||||
source .env
|
||||
```
|
||||
|
||||
3. adapt your `compose.yml`.make sure your `compose.yml` has the necessary traefik-labels. __Attention:__ .env-vars won't be parsed to the "left hand", so you have to set `${STACK_NAME}`-vars of the traefik-labels used in recipes in your `compose.yml` manually:
|
||||
#### 3. adapt your `compose.yml`
|
||||
|
||||
make sure your `compose.yml` contains the necessary traefik-labels.
|
||||
|
||||
___Attention:__ .env-vars won't be parsed to the "left hand", so you can't simply copy the labels of a recipe and set STACK_NAME es env-var, but you have to set `${STACK_NAME}`-vars of the traefik-labels used in recipes in your `compose.yml` manually (here: `example_com`):_
|
||||
|
||||
```
|
||||
services:
|
||||
@@ -589,7 +596,7 @@ services:
|
||||
- "traefik.http.middlewares.example_com-redirect.redirectscheme.permanent=true"
|
||||
```
|
||||
|
||||
When starting your adaption from a docker-compose-file: be also aware, that not all compose-features are supported by docker swarm, and some parts need to be nested in `deploy`.
|
||||
When starting your custom stack from a docker-compose-file (be aware, that not all compose-features are supported by docker swarm, and some parts need to be nested in `deploy`).
|
||||
|
||||
Make also sure, you attach your app to the `proxy`-overlay network, so traefik may find it:
|
||||
|
||||
@@ -611,7 +618,7 @@ networks:
|
||||
docker stack deploy -c compose.yml example_com
|
||||
```
|
||||
|
||||
__Useful for troubleshooting:__ there is `docker service inspect`, so e.g. make sure via inspect, your .env-files where successfully read by docker swarm: `docker service inspect example_com`
|
||||
__Useful for troubleshooting:__ there is `docker service inspect`, so e.g. make sure via inspect, your .env-files were successfully read by docker swarm: `docker service inspect example_com_app` (for inspect you have to select a service, not the whole stack).
|
||||
|
||||
If your app/deployment may be useful for others: please consider creating a recipe for it. The necessary steps from here on are only a few ;)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user