Browse Source

Merge pull request 'separar-build-runtime' (#1) from separar-build-runtime into master

Reviewed-on: https://git.sindominio.net/gancio/docker-gancio/pulls/1
dev
siroco 9 months ago
parent
commit
3b2ab02695
  1. 6
      .gitignore
  2. 66
      Dockerfile
  3. 2
      docker-compose.yml

6
.gitignore

@ -0,0 +1,6 @@
# datos de gancio
db.sqlite
config.json
uploads
user_locale

66
Dockerfile

@ -1,21 +1,65 @@
FROM registry.sindominio.net/debian as builder
## Docker para COMPILACION de Gancio
##
## - Descarga codigo de Framagit.org
## - Compila la libreria Gancio
## - Dependencias: nodejs + yarn
##
FROM registry.sindominio.net/debian
RUN apt-get update && \
apt-get install -y --no-install-recommends curl gnupg2 ca-certificates
apt-get install -y --no-install-recommends curl gnupg2 ca-certificates git
RUN echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list
# Install Node Latest
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
apt-get install -y nodejs
WORKDIR /opt
ARG GANCIO_VERSION=master
RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
#RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarn-archive-keyring.gpg
RUN echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && \
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 yarn
apt-get install -y --no-install-recommends yarn
RUN git clone https://framagit.org/les/gancio.git && \
cd gancio && \
git checkout $GANCIO_VERSION
WORKDIR /opt/gancio
RUN yarn install && \
yarn build && \
yarn pack --filename=gancio.tgz
## Docker para EJECUCION de Gancio
##
## - Usa la libreria Gancio compilada antes
## - Instala todas las dependencias de produccion
## - Crea un link en /usr/local/bin/gancio
## - Dependencias: nodejs
##
FROM registry.sindominio.net/debian
RUN apt-get update && \
apt-get install -y --no-install-recommends curl gnupg2 ca-certificates git
# Install Node Latest
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get install -y nodejs
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
apt-get install -y nodejs
COPY --from=0 /opt/gancio/gancio.tgz ./
RUN tar zxf gancio.tgz && \
mv package gancio && \
rm gancio.tgz
WORKDIR /gancio
WORKDIR /
RUN yarn global add gancio
RUN npm install --production && \
ln -s /gancio/server/cli.js /usr/local/bin/gancio

2
docker-compose.yml

@ -4,7 +4,7 @@ services:
gancio:
build: .
restart: always
image: node:latest
image: gancio:latest
container_name: gancio
command: gancio start --docker --db=sqlite
environment:

Loading…
Cancel
Save