feat: lamassu initial dockerize approach

feat: improve dockerization

feat: finished initial versions of dockerfiles

fix: small fixes to image building
This commit is contained in:
Sérgio Salgado 2022-03-17 16:04:34 +00:00
parent b0860cdea5
commit bd82285ecf
14 changed files with 484 additions and 20 deletions

View file

@ -0,0 +1,61 @@
FROM ubuntu:20.04 as base
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Lisbon
RUN apt-get update
RUN apt-get install -y -q curl \
sudo \
git \
python2-minimal \
build-essential \
libpq-dev \
net-tools
RUN curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
RUN apt-get install nodejs -y -q
FROM base as build-l-s
WORKDIR /app
COPY bin/ packages/lamassu-server/bin
COPY lib/ packages/lamassu-server/lib
COPY tools/ packages/lamassu-server/tools
COPY migrations/ packages/lamassu-server/migrations
COPY package.json packages/lamassu-server/package.json
COPY Lamassu_CA.pem packages/lamassu-server/Lamassu_CA.pem
WORKDIR /app/packages/lamassu-server
RUN chmod +x tools/build-docker-certs.sh
RUN chmod +x bin/lamassu-server-entrypoint.sh
RUN npm install
FROM ubuntu:20.04 as production-l-s
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Lisbon
RUN apt-get update
RUN apt-get install -y -q curl \
sudo \
git \
python2-minimal \
build-essential \
libpq-dev \
net-tools
RUN curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
RUN apt-get install nodejs -y -q
COPY --from=build-l-s /app/packages/lamassu-server /app/packages/lamassu-server
WORKDIR /app/packages/lamassu-server
EXPOSE 3000
ENTRYPOINT [ "/app/packages/lamassu-server/bin/lamassu-server-entrypoint.sh" ]