From a43cc309a3db319cb14a44c4cecdc550d3e55558 Mon Sep 17 00:00:00 2001 From: Siroco Date: Sun, 18 Apr 2021 01:06:37 +0200 Subject: [PATCH] gancio docker with sqlite --- Dockerfile | 17 +++++++++++++ README.md | 61 ++++++++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 17 +++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2d64c6e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM registry.sindominio.net/debian as builder + +RUN echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list && \ + +RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list +RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - + +# Install Yarn +RUN apt-get update && \ + apt-get install -y --no-install-recommends curl yarn + +# Install Node Latest +RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - +apt-get install -y nodejs + +WORKDIR / +RUN yarn global add gancio --prod diff --git a/README.md b/README.md new file mode 100644 index 0000000..5da636e --- /dev/null +++ b/README.md @@ -0,0 +1,61 @@ +# GANCIO for SINDOMINIO + +https://gancio.org/install/docker + +## Dockerfile + +El original funciona sobre la imagen de docker de node + +``` +FROM node:latest +WORKDIR / +RUN yarn global add gancio +``` + +Nosotros debemos funcionar a través de nuestro Debian en nuestro registry, +asi que adaptamos un poco el Dockerfile al estilo la guía de instalación de GNU/Debian + +https://gancio.org/install/debian + + +``` +FROM registry.sindominio.net/debian as builder + +RUN echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list && \ + +RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list +RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - + +# Install Yarn +RUN apt-get update && \ + apt-get install -y --no-install-recommends curl yarn + +# Install Node Latest +RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - +apt-get install -y nodejs + +WORKDIR / +RUN yarn global add gancio --prod +``` + +## Instalación + +Seguimos los pasos de Gancio + +Ejecutamos: + +``` +touch config.json db.sqlite +mkdir user_locale +``` + +Y luego a buildear + +``` +docker-compose build +docker-compose run --rm gancio gancio setup --docker --db=sqlite +``` + +## TODO + +A ver quien hace un container con PostgreSQL en vez de SQLITE ;) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..8e0ec36 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,17 @@ +version: '3' + +services: + gancio: + build: . + restart: always + image: node:latest + container_name: gancio + command: gancio start --docker --db=sqlite + environment: + - DEBUG=*,-babel,-follow-redirects,-send,-body-parser:*,-express:*,-connect:*,-sequelize:* + volumes: + - ./db.sqlite:/opt/gancio/db.sqlite + - ./config.json:/opt/gancio/config.json + - ./uploads:/opt/gancio/uploads + ports: + - "127.0.0.1:13120:13120"