Files
docker-compose-collection/readme.md
T
2023-09-09 14:53:02 +02:00

65 lines
1.5 KiB
Markdown

# Docker Compose Collection Optimized for Synology
This repository will contain all the Dockerized software I currently use, have used in the past or just briefly tested.
## The way I format my compose files
Each compose file should contain as much variables as possible so in the event of an update to the compose file there is no extra work to replace it with the new file as all the changes are still in the .env file.
Parts with an asterisk (*) should be always present.
### container_name*
```
container_name: ${APP_CONTAINER_NAME:-App}
```
### hostname
```
hostname: app
```
### image*
```
image: publisher/app:${APP_TAG:-latest}
```
The latest tag is the preferred tag.
### restart*
```
restart: ${RESTART:-unless-stopped}
```
### healthcheck
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
Use curl
```
healthcheck:
test: curl -f http://localhost:80/ || exit 1
```
Use wget
```
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:80/
```
If none of the options is available then ommit the use of a health check.
### ports
```
ports:
- ${APP_PORT:-80}:80
```
If there is only one port available use the variable name as in the example above. If there are multiple ports try to use a short desription for all of them. See the example below.
```
ports:
- ${APP_PORT_HTTP:-80}:80
- ${APP_PORT_SSH:-22}:22
```