chore: set restart: unless-stopped on every service

Coolify injects the same value when a compose service omits one, but Dokploy
runs the file as written, so in its default compose mode an omitted policy
leaves the container down after a crash or a host reboot.
This commit is contained in:
tiennm99 committed 2026-09-20 14:34:57 +07:00
1 parent b626c5b70d
commit c2b508c171
10 files changed
+29 -12

No files matched your search

+7 -1
View File
@@ -106,13 +106,19 @@ unprompted:
- **No `ports:`.** Coolify and Dokploy attach the container to their proxy - **No `ports:`.** Coolify and Dokploy attach the container to their proxy
network and map a domain to the internal port. Publishing a port is redundant network and map a domain to the internal port. Publishing a port is redundant
and would additionally expose it on the host. and would additionally expose it on the host.
- **No `restart:` policy.** The platform manages the container lifecycle.
- **No `container_name:`.** Let Compose derive it from the directory. - **No `container_name:`.** Let Compose derive it from the directory.
More generally: these files are tuned to one person's setup and are not meant More generally: these files are tuned to one person's setup and are not meant
to be portable, standard, or turnkey. Prefer leaving a service minimal over to be portable, standard, or turnkey. Prefer leaving a service minimal over
adding hardening or convention that the platform already provides. adding hardening or convention that the platform already provides.
`restart:` is the exception that is *not* omitted. Every service sets
`restart: unless-stopped`, on every container. Coolify injects that exact value
when a service does not declare one, and keeps the declared value when it does;
Dokploy does not inject anything, so in its default compose mode an omitted
policy leaves the container down after a crash or a host reboot. Setting it is
correct on both.
## Secrets ## Secrets
Every service reads secrets from a sibling `.env`. Never commit one — the root Every service reads secrets from a sibling `.env`. Never commit one — the root
+6 -2
View File
@@ -10,10 +10,14 @@ otherwise declare:
- **No published ports.** The platform attaches the container to its proxy - **No published ports.** The platform attaches the container to its proxy
network and maps a domain to the internal port. Publishing one would also network and maps a domain to the internal port. Publishing one would also
expose it on the host. expose it on the host.
- **No `restart:` policy.** The platform manages the container lifecycle.
- **No `container_name:`.** Compose derives it from the directory. - **No `container_name:`.** Compose derives it from the directory.
Services that do publish ports or set `restart:` say so in their own README. Every container does set `restart: unless-stopped`. Coolify would inject the
same value on its own, but Dokploy leaves an omitted policy alone, which in its
default compose mode means the container stays down after a reboot.
Services that publish ports or set `container_name:` say so in their own
README.
## Layout ## Layout
+2 -3
View File
@@ -10,9 +10,8 @@ API to it. The Alloy config is embedded inline via Compose `configs:`, so
there is no `config.alloy` on disk, and every setting comes from a shell there is no `config.alloy` on disk, and every setting comes from a shell
variable rather than a `.env` file. variable rather than a `.env` file.
Uses `docker-compose.yml`, and sets `restart: unless-stopped` and Uses `docker-compose.yml`, and sets `container_name: alloy` — unlike the
`container_name: alloy` — unlike the platform-managed services described in the platform-managed services described in the [root README](../README.md).
[root README](../README.md).
## What it collects ## What it collects
+1
View File
@@ -1,6 +1,7 @@
services: services:
code-server: code-server:
build: . build: .
restart: unless-stopped
hostname: ${SERVICE_HOSTNAME} hostname: ${SERVICE_HOSTNAME}
environment: environment:
- PUID=1000 - PUID=1000
+3 -3
View File
@@ -2,9 +2,9 @@
[Couchbase Server](https://www.couchbase.com), single node. [Couchbase Server](https://www.couchbase.com), single node.
Uses `docker-compose.yml`, publishes ports, and sets `restart: unless-stopped` Uses `docker-compose.yml`, publishes ports, and sets `container_name: db` —
and `container_name: db` — unlike the platform-managed services described in unlike the platform-managed services described in the
the [root README](../README.md). [root README](../README.md).
## Networking ## Networking
+2
View File
@@ -4,6 +4,7 @@
services: services:
diun: diun:
image: crazymax/diun:4 image: crazymax/diun:4
restart: unless-stopped
command: serve command: serve
environment: environment:
DIUN_PROVIDERS_DOCKER: "true" DIUN_PROVIDERS_DOCKER: "true"
@@ -26,6 +27,7 @@ services:
# Read-only slice of the Docker API. POST is revoked by default in this image. # Read-only slice of the Docker API. POST is revoked by default in this image.
dockerproxy: dockerproxy:
image: tecnativa/docker-socket-proxy:latest image: tecnativa/docker-socket-proxy:latest
restart: unless-stopped
environment: environment:
CONTAINERS: 1 CONTAINERS: 1
IMAGES: 1 IMAGES: 1
+3
View File
@@ -1,6 +1,7 @@
services: services:
db: db:
image: postgres:16-alpine image: postgres:16-alpine
restart: unless-stopped
environment: environment:
POSTGRES_DB: gitea POSTGRES_DB: gitea
POSTGRES_USER: gitea POSTGRES_USER: gitea
@@ -15,6 +16,7 @@ services:
gitea: gitea:
image: gitea/gitea:latest image: gitea/gitea:latest
restart: unless-stopped
depends_on: depends_on:
db: db:
condition: service_healthy condition: service_healthy
@@ -33,6 +35,7 @@ services:
gitea-mirror: gitea-mirror:
image: ghcr.io/raylabshq/gitea-mirror:latest image: ghcr.io/raylabshq/gitea-mirror:latest
restart: unless-stopped
pull_policy: always pull_policy: always
volumes: volumes:
- gitea-mirror-data:/app/data - gitea-mirror-data:/app/data
+1
View File
@@ -1,6 +1,7 @@
services: services:
opencode-web: opencode-web:
build: . build: .
restart: unless-stopped
command: command:
- web - web
- '--hostname' - '--hostname'
+1
View File
@@ -1,6 +1,7 @@
services: services:
paseo: paseo:
build: . build: .
restart: unless-stopped
hostname: ${SERVICE_HOSTNAME} hostname: ${SERVICE_HOSTNAME}
environment: environment:
- PASEO_PASSWORD=${PASEO_PASSWORD} - PASEO_PASSWORD=${PASEO_PASSWORD}
+3 -3
View File
@@ -2,9 +2,9 @@
[TraffMonetizer](https://traffmonetizer.com) bandwidth-sharing client. [TraffMonetizer](https://traffmonetizer.com) bandwidth-sharing client.
Uses `docker-compose.yml`, and sets `restart: always` and Uses `docker-compose.yml`, and sets `container_name: tm` and `restart: always`
`container_name: tm` — unlike the platform-managed services described in the rather than the `unless-stopped` everything else uses — unlike the
[root README](../README.md). Publishes no ports; the client only makes outbound platform-managed services described in the [root README](../README.md). Publishes no ports; the client only makes outbound
connections. connections.
The image tag is `arm64v8`. Change it to match the host architecture. The image tag is `arm64v8`. Change it to match the host architecture.