refactore(service): improve Onetimesecret

- fix ENVs not having default values
- improve formatting and naming
This commit is contained in:
peaklabs-dev
2025-05-20 16:16:23 +02:00
parent 398debcdfc
commit 4664ec1214
2 changed files with 24 additions and 24 deletions

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@@ -1,37 +1,25 @@
# documentation: https://docs.onetimesecret.com # documentation: https://docs.onetimesecret.com
# slogan: Share sensitive information securely with self-destructing links that are only viewable once. # slogan: Share sensitive information securely with self-destructing links that are only viewable once.
# tags: auth,password,secret,secure # tags: auth,password,secret,secure
# logo: svgs/one-time-secret.svg # logo: svgs/onetimesecret.svg
# port: 3000 # port: 3000
services: services:
onetimesecret-redis:
image: "redis:alpine"
restart: unless-stopped
command: redis-server --requirepass ${SERVICE_PASSWORD_REDIS}
healthcheck:
test:
- CMD
- redis-cli
- ping
interval: 30s
timeout: 10s
retries: 3
onetimesecret: onetimesecret:
image: "onetimesecret/onetimesecret:latest" image: onetimesecret/onetimesecret:latest
restart: unless-stopped
environment: environment:
- "AUTH_AUTOVERIFY=${AUTH_AUTOVERIFY-true}"
- "AUTH_SIGNUP=${AUTH_SIGNUP-true}"
- "COLONEL=${COLONEL-admin@example.com}"
- "HOST=${HOST}"
- "REDIS_URL=redis://:${SERVICE_PASSWORD_REDIS}@onetimesecret-redis:6379/0"
- "SECRET=${SERVICE_PASSWORD_ONETIMESECRET}"
- "SSL=${SSL-true}"
- RACK_ENV=production
- SERVICE_FQDN_ONETIMESECRET_3000 - SERVICE_FQDN_ONETIMESECRET_3000
- AUTH_AUTOVERIFY=${AUTH_AUTOVERIFY:-true}
- AUTH_SIGNUP=${AUTH_SIGNUP:-true}
- COLONEL=${COLONEL:-admin@example.com}
- HOST=${HOST:-localhost}
- REDIS_URL=redis://:${SERVICE_PASSWORD_REDIS}@redis:6379/0
- SECRET=${SERVICE_PASSWORD_ONETIMESECRET}
- SSL=${SSL:-false}
- RACK_ENV=production
depends_on: depends_on:
- onetimesecret-redis redis:
condition: service_healthy
healthcheck: healthcheck:
test: test:
- CMD - CMD
@@ -42,3 +30,15 @@ services:
interval: 30s interval: 30s
timeout: 10s timeout: 10s
retries: 3 retries: 3
redis:
image: redis:8-alpine
command: redis-server --requirepass ${SERVICE_PASSWORD_REDIS}
healthcheck:
test:
- CMD
- redis-cli
- ping
interval: 30s
timeout: 10s
retries: 3