mirror of
https://github.com/PAPAMICA/docker-compose-collection.git
synced 2026-01-19 00:37:32 +01:00
80 lines
2.4 KiB
YAML
80 lines
2.4 KiB
YAML
# Maintainer: Mickael "PAPAMICA" Asseline
|
|
# Update: 2022-05-13
|
|
|
|
#& type: 3
|
|
#& title: YourLS
|
|
#& description: Link shorter
|
|
#& note: Website: <a href='https://yourls.org/' target='_blank' rel='noopener'>YourLS.org</a>
|
|
#& categories: SelfHosted, PAPAMICA
|
|
#& platform: linux
|
|
#& logo: https://img.papamica.com/logo/yourls.png
|
|
|
|
#% SERVICE: Name of the service (No spaces or points) [yourls]
|
|
#% DATA_LOCATION: Data localization (Example: /apps/service) [/_data/apps]
|
|
#% URL: Service URL (Example: service.papamica.fr or service.com)
|
|
#% NETWORK: Your Traefik network (Example: proxy) [proxy]
|
|
#% DB_USER: Database user (No spaces or points) [yourls]
|
|
#% DB_PASSWORD: Database user password
|
|
#% DB_ROOT: Database root password
|
|
#% ADMIN_USER: Admin user for YourLS (No spaces or points) [admin]
|
|
#% ADMIN_PASSWORD: Admin password for YourLS
|
|
|
|
# Work with Portainer
|
|
version: "2"
|
|
services:
|
|
yourls:
|
|
image: yourls:apache
|
|
container_name: $SERVICE
|
|
volumes:
|
|
- $DATA_LOCATION/$SERVICE/config:/var/www/html
|
|
environment:
|
|
YOURLS_DB_USER: $DB_USER
|
|
YOURLS_DB_PASS: $DB_PASSWORD
|
|
YOURLS_DB_HOST: $SERVICE-db
|
|
YOURLS_DB_NAME: yourls
|
|
YOURLS_SITE: https://$URL
|
|
YOURLS_PASS: $ADMIN_PASSWORD
|
|
YOURLS_USER: $ADMIN_USER
|
|
depends_on:
|
|
- $SERVICE-db
|
|
healthcheck:
|
|
test: curl --fail http://localhost:80 || exit 1
|
|
interval: 1m
|
|
timeout: 30s
|
|
retries: 3
|
|
networks:
|
|
- default
|
|
labels:
|
|
- "autoupdate=monitor" # https://github.com/PAPAMICA/container-updater
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.$SERVICE.entrypoints=https"
|
|
- "traefik.http.routers.$SERVICE.rule=Host(`$URL`)"
|
|
- "traefik.http.routers.$SERVICE.tls=true"
|
|
- "traefik.http.routers.$SERVICE.tls.certresolver=http"
|
|
- "traefik.docker.network=$NETWORK"
|
|
|
|
|
|
yourls-db:
|
|
image: mysql:5.7
|
|
container_name: $SERVICE-db
|
|
restart: always
|
|
environment:
|
|
- MYSQL_ROOT_PASSWORD=$DB_PASSWORD
|
|
- MYSQL_DATABASE=yourls
|
|
- MYSQL_USER=$DB_USER
|
|
- MYSQL_PASSWORD=$DB_PASSWORD
|
|
volumes:
|
|
- $DATA_LOCATION/$SERVICE/db:/var/lib/mysql
|
|
healthcheck:
|
|
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
|
|
timeout: 20s
|
|
retries: 10
|
|
networks:
|
|
- default
|
|
labels:
|
|
- "autoupdate=monitor" # https://github.com/PAPAMICA/container-updater
|
|
|
|
networks:
|
|
default:
|
|
external:
|
|
name: $NETWORK |