diff options
| author | Akshay Nair <phenax5@gmail.com> | 2026-07-03 22:37:54 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2026-07-03 22:37:57 +0530 |
| commit | 1f4c276914a7e5b03a31345d7bf5966e8aff9081 (patch) | |
| tree | 3babed15427186fce6cb51e7d52c314d65159b0d | |
| parent | 317a8a38f4206279a9aea4c7a92ff44f9b78259a (diff) | |
| download | bacchus-remote-1f4c276914a7e5b03a31345d7bf5966e8aff9081.tar.gz bacchus-remote-1f4c276914a7e5b03a31345d7bf5966e8aff9081.zip | |
Split services to core/rest + instructions
| -rw-r--r-- | README.md | 29 | ||||
| -rw-r--r-- | docker-compose.yml | 8 | ||||
| -rw-r--r-- | justfile | 6 | ||||
| -rwxr-xr-x | setup.sh | 24 |
4 files changed, 52 insertions, 15 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..02a6aa5 --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +# My hosted services + +### Services +- send +- cgit + +### Usage + +#### Sync config +`just upload` + +#### Server setup +`just setup setup` + +#### Run core services +`just setup core up -d` + +#### Run all services +`just setup start` + +#### Stop all services +`just setup stop` + +#### Update +`just setup update` + +#### Local stuff for the above +`just local-setup ...` + diff --git a/docker-compose.yml b/docker-compose.yml index f6a02f8..0216d9d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,6 @@ services: nginx-proxy: + profiles: [core] container_name: nginx-proxy image: 'jwilder/nginx-proxy:alpine' restart: always @@ -16,6 +17,7 @@ services: - proxy-html:/usr/share/nginx/html proxy-letsencrypt: + profiles: [core] image: 'nginxproxy/acme-companion' restart: always environment: @@ -31,6 +33,7 @@ services: - acme:/etc/acme.sh send: + profiles: [services] image: 'registry.gitlab.com/timvisee/send:v3.4.27' restart: always ports: @@ -54,18 +57,21 @@ services: - MAX_EXPIRE_SECONDS=31536000 - MAX_DOWNLOADS=100 - MAX_FILE_SIZE=1073741824 + depends_on: + - redis redis: + profiles: [services] image: 'redis:alpine' restart: always volumes: - redis:/data cgit: + profiles: [services] image: 'joseluisq/alpine-cgit:2.9' ports: - 8080:80 - - '1234:1234' environment: - USE_CUSTOM_CONFIG=true volumes: @@ -17,8 +17,10 @@ df: upload: just copy . "${SSH_USER}@${SSH_HOST}:{{TARGET_DIR}}" -start-remote: - just ssh "{{TARGET_DIR}}/setup.sh" start +restart-remote: (setup "start") setup *args: just ssh "{{TARGET_DIR}}/setup.sh" "$@" + +local-setup *args: + ROOT_DIR="$PWD" ./setup.sh "$@" @@ -2,18 +2,18 @@ set -eu +ROOT_DIR=${ROOT_DIR:-"/opt/project"} + setup() { packages; firewall; } -start() { - cd /opt/project - stop; - docker compose up -d -} +services() { cd "$ROOT_DIR"; docker compose --profile services "$@"; } -stop() { - cd /opt/project - docker compose down send nginx-proxy redis cgit -} +core() { cd "$ROOT_DIR"; docker compose --profile core "$@"; } + +# TODO: use --wait and add health checks +start() { stop || true; services up -d; } + +stop() { services down; } packages() { apt install \ @@ -29,12 +29,12 @@ firewall() { } update() { - apt update || true; - cd /opt/project && docker compose build --pull + apt update; + services build --pull; } cmd="$1"; shift; case "$cmd" in - setup|update|start|stop|firewall|packages) "$cmd" "$@" ;; + setup|update|start|stop|firewall|packages|services|core) "$cmd" "$@" ;; *) echo "Invalid command: $cmd"; exit 1 ;; esac |
