|
|
|
## 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-recomends golang
|
|
|
|
|
|
|
|
WORKDIR /
|
|
|
|
|
|
|
|
COPY installer .
|
|
|
|
|
|
|
|
WORKDIR /installer
|
|
|
|
|
|
|
|
RUN go get . && \
|
|
|
|
go build -o gancio-installer
|
|
|
|
# --- #
|
|
|
|
|
|
|
|
FROM registry.sindominio.net/debian
|
|
|
|
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y --no-install-recommends curl gnupg2 ca-certificates git npm
|
|
|
|
|
|
|
|
COPY --from=builder /gancio/gancio.tgz ./
|
|
|
|
|
|
|
|
RUN tar zxf gancio.tgz && \
|
|
|
|
mv package gancio && \
|
|
|
|
rm gancio.tgz
|
|
|
|
|
|
|
|
WORKDIR /gancio
|
|
|
|
|
|
|
|
# Instalar solo las dependencias de produccion y crear symlink para ejecucion
|
|
|
|
RUN npm install --production && \
|
|
|
|
ln -s /gancio/server/cli.js /usr/bin/gancio
|
|
|
|
|
|
|
|
COPY --from=builder /installer/gancio-installer /usr/bin/gancio-installer
|
|
|
|
|
|
|
|
ADD entrypoint.sh /
|
|
|
|
|
|
|
|
RUN chmod 755 /entrypoint.sh
|
|
|
|
|
|
|
|
# Preconfig
|
|
|
|
RUN mkdir /data
|
|
|
|
COPY config.json /gancio/config.json.example
|
|
|
|
|
|
|
|
VOLUME ["/data"]
|
|
|
|
|
|
|
|
ENTRYPOINT [ "/bin/sh", "/entrypoint.sh" ]
|