From edb3f22044d089cc1440c117367d1a141f693a1c Mon Sep 17 00:00:00 2001 From: Fabian Stamm Date: Wed, 7 Jun 2023 21:11:05 +0200 Subject: [PATCH] Switching to Earthfile --- Dockerfile | 32 -------------------------------- Earthfile | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 32 deletions(-) delete mode 100644 Dockerfile create mode 100644 Earthfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 159fbda..0000000 --- a/Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM node:19 as builder - -RUN mkdir -p /app -WORKDIR /app - -COPY ["package.json", "yarn.lock", ".yarnrc.yml", "tsconfig.json", "/app/"] -COPY [".yarn", "/app/.yarn"] -COPY ["src", "/app/src"] - - -RUN yarn install -RUN yarn build - -FROM node:19 - -LABEL maintainer="Fabian Stamm " - -RUN mkdir -p /app -WORKDIR /app - -ENV NODE_ENV=production - -COPY ["package.json", "yarn.lock", ".yarnrc.yml", "/app/"] -COPY [".yarn", "/app/.yarn"] - -RUN yarn install - -COPY --from=builder /app/lib/ /app/lib - -VOLUME [ "/app/logs", "/app/persist"] - -CMD ["node", "lib/index.js"] \ No newline at end of file diff --git a/Earthfile b/Earthfile new file mode 100644 index 0000000..67bb8c0 --- /dev/null +++ b/Earthfile @@ -0,0 +1,19 @@ +VERSION 0.7 +FROM node:lts-alpine3.18 +WORKDIR /build + +docker-multi: + BUILD --platform linux/amd64 --platform linux/arm64 +docker + +docker: + COPY package.json yarn.lock .yarnrc.yml tsconfig.json . + COPY src ./src + COPY .yarn ./.yarn + RUN ls -l + RUN yarn install + RUN yarn build + WORKDIR /build + ENTRYPOINT ["node", "lib/index.js"] + ARG EARTHLY_TARGET_TAG + ARG TAG=$EARTHLY_TARGET_TAG + SAVE IMAGE --push docker.hibas123.de/telegram-rss:$TAG