## ARGUMENTOS: ## GANCIO_VERSION tag/rama desde la que se construye gancio (defecto: master) FROM registry.sindominio.net/debian as builder RUN apt-get update && \ apt-get install -y --no-install-recommends curl gnupg2 ca-certificates git npm WORKDIR / ARG GANCIO_VERSION=master RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list COPY pubkey.gpg . RUN cat pubkey.gpg | apt-key add - RUN apt-get update && \ apt-get install -y --no-install-recommends yarn RUN git clone https://framagit.org/les/gancio.git && \ cd gancio && \ git checkout $GANCIO_VERSION # TODO: Check Sign WORKDIR /gancio RUN yarn install && \ yarn build && \ yarn pack --filename=gancio.tgz RUN apt-get install -y --no-install-recommends golang WORKDIR /tmp/installer COPY installer . RUN go build -o gancio-installer FROM registry.sindominio.net/debian ENV TZ=Europe/Madrid RUN apt-get update && \ apt-get install -y --no-install-recommends npm COPY --from=builder /gancio/gancio.tgz ./ RUN tar zxf gancio.tgz && \ mv package gancio && \ rm gancio.tgz WORKDIR /gancio RUN npm install --production && \ ln -s /gancio/server/cli.js /usr/bin/gancio COPY --from=builder /tmp/installer /usr/share/local/gancio-installer RUN cp /usr/share/local/gancio-installer/gancio-installer /usr/bin/gancio-installer ADD entrypoint.sh / RUN chmod 755 /entrypoint.sh RUN mkdir /data COPY config.json /gancio/config.json.example VOLUME ["/data"] ENTRYPOINT [ "/bin/sh", "/entrypoint.sh" ] CMD ["start", "--config", "/data/config.json"]