From f9d7a5d09e27a6e860b0bb4b2fc8255f206ba895 Mon Sep 17 00:00:00 2001 From: Renne Rocha Date: Fri, 13 Dec 2024 20:42:02 -0300 Subject: [PATCH] Temporary configuration to run Gancio on fly.io --- gancio/Dockerfile | 16 ++++++++++++++++ gancio/config.json | 41 +++++++++++++++++++++++++++++++++++++++++ gancio/fly.toml | 26 ++++++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 gancio/Dockerfile create mode 100644 gancio/config.json create mode 100644 gancio/fly.toml diff --git a/gancio/Dockerfile b/gancio/Dockerfile new file mode 100644 index 0000000..fef6949 --- /dev/null +++ b/gancio/Dockerfile @@ -0,0 +1,16 @@ +FROM node:18-slim AS nodejs-base +RUN apt-get -q update && \ + env DEBIAN_FRONTEND=noninteractive apt-get -y install git && \ + apt-get clean && rm -fr /var/lib/apt/lists/* + +FROM nodejs-base AS build +RUN yarnpkg global add --network-timeout 1000000000 --latest --production --silent https://gancio.org/latest.tgz && \ + apt-get clean && rm -fr /var/lib/apt/lists/* && \ + yarnpkg cache clean + +FROM nodejs-base +COPY --from=build /usr/local/share/.config/yarn/ /usr/local/share/.config/yarn/ +COPY config.json /config.json +RUN ln -s ../share/.config/yarn/global/node_modules/.bin/gancio /usr/local/bin/gancio + +ENTRYPOINT ["/usr/local/bin/gancio"] diff --git a/gancio/config.json b/gancio/config.json new file mode 100644 index 0000000..37bb030 --- /dev/null +++ b/gancio/config.json @@ -0,0 +1,41 @@ +{ + "baseurl": "https://agenda.rocha.dev.br", + "hostname": "agenda.rocha.dev.br", + "server": { + "host": "0.0.0.0", + "port": 13120 + }, + "log_level": "debug", + "log_path": "/data/logs", + "db": { + "dialect": "sqlite", + "storage": "/data/gancio.sqlite", + "logging": false, + "dialectOptions": { + "autoJsonMap": true + }, + "retry": { + "match": [ + null, + null, + null, + {}, + {} + ], + "max": 15 + } + }, + "user_locale": "/data/user_locale", + "upload_path": "/data/uploads", + "proxy": { + "protocol": "", + "hostname": "", + "host": "", + "port": "", + "auth": { + "username": "", + "password": "" + }, + "headers": {} + } +} diff --git a/gancio/fly.toml b/gancio/fly.toml new file mode 100644 index 0000000..436ac56 --- /dev/null +++ b/gancio/fly.toml @@ -0,0 +1,26 @@ +# fly.toml app configuration file generated for agenda-rocha-dev-br on 2024-12-03T08:03:28-03:00 +# +# See https://fly.io/docs/reference/configuration/ for information about how to use this file. +# + +app = 'agenda-rocha-dev-br' +primary_region = 'gru' + +[build] + +[[mounts]] + source = 'gancio_data' + destination = '/data' + +[http_service] + internal_port = 13120 + force_https = true + auto_stop_machines = 'stop' + auto_start_machines = true + min_machines_running = 0 + processes = ['app'] + +[[vm]] + memory = '1gb' + cpu_kind = 'shared' + cpus = 1