Update: readme.md
This commit is contained in:
@@ -14,26 +14,57 @@ Parts with an asterisk (*) should be always present.
|
|||||||
```
|
```
|
||||||
|
|
||||||
### hostname
|
### hostname
|
||||||
|
Should only be added if the desired hostname is different form the service name.
|
||||||
|
|
||||||
```
|
```
|
||||||
hostname: app
|
hostname: app
|
||||||
```
|
```
|
||||||
|
|
||||||
### image*
|
### image*
|
||||||
|
|
||||||
|
Docker Hub is always the prefered location to use for images. If there is no image hosted there, or the current image is not maintained, services like ghcr.io might be used as well but alway as a second choice.
|
||||||
|
|
||||||
```
|
```
|
||||||
image: publisher/app:${APP_TAG:-latest}
|
image: publisher/app:${APP_TAG:-latest}
|
||||||
```
|
```
|
||||||
|
|
||||||
The latest tag is the preferred tag.
|
The latest tag is the preferred tag.
|
||||||
|
|
||||||
|
### user
|
||||||
|
|
||||||
|
```
|
||||||
|
user: ${UID:-1024}:${GID:-101}
|
||||||
|
```
|
||||||
|
|
||||||
|
Alway try to use the UID and GID of the default admin account in one form or another when there are folders to be mounted. In this example under user should be the preferred way but will not always work. Another way is trhough environment variables.
|
||||||
|
|
||||||
|
If there is no way to set the owner of the files to be created by the container then ommit the use of it altogheter.
|
||||||
|
|
||||||
### restart*
|
### restart*
|
||||||
|
|
||||||
|
Unless-stopped is the preferred restart policy.
|
||||||
|
|
||||||
```
|
```
|
||||||
restart: ${RESTART:-unless-stopped}
|
restart: ${RESTART:-unless-stopped}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### network_mode
|
||||||
|
|
||||||
|
```
|
||||||
|
network_mode: host
|
||||||
|
```
|
||||||
|
|
||||||
|
If there is no reason to set the network mode to something other than bridge then ommit the use of this part.
|
||||||
|
Bridge (nothing set) is always the preferred way but there are containers that don't need any way in and can make use of the following.
|
||||||
|
|
||||||
|
```
|
||||||
|
network_mode: none
|
||||||
|
```
|
||||||
|
|
||||||
### healthcheck
|
### healthcheck
|
||||||
If the image does not contain a health check already then implement one of the following options.
|
If the image does not contain a health check already then implement one of the following options.
|
||||||
|
|
||||||
Always try to use an image specific healthcheck, if available
|
Always try to use an image specific healthcheck, if available.
|
||||||
|
|
||||||
Use curl
|
Use curl
|
||||||
```
|
```
|
||||||
@@ -49,6 +80,34 @@ Use wget
|
|||||||
|
|
||||||
If none of the options is available then ommit the use of a health check.
|
If none of the options is available then ommit the use of a health check.
|
||||||
|
|
||||||
|
### environment
|
||||||
|
|
||||||
|
```
|
||||||
|
environment:
|
||||||
|
UID: ${UID:-1024}
|
||||||
|
GID: ${GID:-101}
|
||||||
|
TZ: ${TZ:-Europe/Amsterdam}
|
||||||
|
APP_VARIABLE_NAME: ${APP_VARIABLE_NAME:-variable}
|
||||||
|
```
|
||||||
|
|
||||||
|
UID (User ID), GID (Group ID) and TZ (TimeZone) should always use these variable names, see example below. This is so that if there is a change in one of them it will be the new value in all services in the stack (if there is more than 1).
|
||||||
|
|
||||||
|
```
|
||||||
|
environment:
|
||||||
|
APP_UID: ${UID:-1024}
|
||||||
|
APP_GID: ${GID:-101}
|
||||||
|
TIMEZONE: ${TZ:-Europe/Amsterdam}
|
||||||
|
```
|
||||||
|
|
||||||
|
Other environment variables should always be prefixed by the name of the application. An abbreviation to a application name should be replaced by the full name. See example below.
|
||||||
|
|
||||||
|
```
|
||||||
|
environment:
|
||||||
|
VARIABLE1: ${APP_VARIABLE1:-variable1}
|
||||||
|
APP_VARIABLE2: ${APP_VARIABLE2:-variable2}
|
||||||
|
A_VARIABLE3: ${APP_VARIABLE3:-variable3}
|
||||||
|
```
|
||||||
|
|
||||||
### ports
|
### ports
|
||||||
```
|
```
|
||||||
ports:
|
ports:
|
||||||
@@ -62,3 +121,23 @@ If there is only one port available use the variable name as in the example abov
|
|||||||
- ${APP_PORT_HTTP:-80}:80
|
- ${APP_PORT_HTTP:-80}:80
|
||||||
- ${APP_PORT_SSH:-22}:22
|
- ${APP_PORT_SSH:-22}:22
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### volumes
|
||||||
|
|
||||||
|
```
|
||||||
|
volumes:
|
||||||
|
- /${SYNOLOGY_VOLUME:-volume1}/docker/${STACK_NAME:-stack}/${APP_CONTAINER_NAME:-App}/config:/config
|
||||||
|
```
|
||||||
|
|
||||||
|
The files and folders for the image should be stored in the following folder: /volume1/docker/stack/App
|
||||||
|
|
||||||
|
Only the docker folder in here is a fixed folder as this folder is created by Synology as default folder for Docker.
|
||||||
|
|
||||||
|
All files and folders mouted in the container should be in its correct subfolders under the folder mentioned before. For instance:
|
||||||
|
|
||||||
|
| Container | Host |
|
||||||
|
|---|---|
|
||||||
|
| /config | /volume1/docker/stack/App/config |
|
||||||
|
| /config.json | /volume1/docker/stack/App/config.json |
|
||||||
|
| subfolder/config | /volume1/docker/stack/App/subfolder/config |
|
||||||
|
| subfolder/config.json | /volume1/docker/stack/App/subfolder/config.json |
|
||||||
|
|||||||
Reference in New Issue
Block a user