From 2f02915446a7fc36a0549a756b7165f5a05db02e Mon Sep 17 00:00:00 2001 From: Abel Luck Date: Tue, 6 Jun 2023 06:47:56 +0000 Subject: [PATCH] metamigo-worker: dockerfiles are no longer needed as the entrypoint is metamigo-cli --- apps/metamigo-worker/Dockerfile | 61 ----------------------- apps/metamigo-worker/docker-entrypoint.sh | 23 --------- 2 files changed, 84 deletions(-) delete mode 100644 apps/metamigo-worker/Dockerfile delete mode 100644 apps/metamigo-worker/docker-entrypoint.sh diff --git a/apps/metamigo-worker/Dockerfile b/apps/metamigo-worker/Dockerfile deleted file mode 100644 index b18b543..0000000 --- a/apps/metamigo-worker/Dockerfile +++ /dev/null @@ -1,61 +0,0 @@ -FROM node:20-bullseye as builder - -ARG METAMIGO_DIR=/opt/metamigo -RUN mkdir -p ${METAMIGO_DIR}/ -WORKDIR ${METAMIGO_DIR} -COPY package.json tsconfig.json ${METAMIGO_DIR}/ -COPY . ${METAMIGO_DIR}/ - -RUN npx --no-install tsc --build --verbose -RUN npm install -RUN npm run build - -RUN rm -Rf ./node_modules - -FROM node:20-bullseye as clean -ARG METAMIGO_DIR=/opt/metamigo - -COPY --from=builder ${METAMIGO_DIR} ${METAMIGO_DIR}/ - -RUN rm -Rf ./node_modules - -FROM node:20-bullseye as pristine -LABEL maintainer="Abel Luck " - -RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ - apt-get install -y --no-install-recommends --fix-missing \ - postgresql-client dumb-init ffmpeg - -ARG METAMIGO_DIR=/opt/metamigo -ENV METAMIGO_DIR ${METAMIGO_DIR} -RUN mkdir -p ${METAMIGO_DIR} -RUN chown -R node:node ${METAMIGO_DIR}/ - -COPY docker-entrypoint.sh /docker-entrypoint.sh -RUN chmod +x /docker-entrypoint.sh - -COPY --from=clean ${METAMIGO_DIR}/ ${METAMIGO_DIR}/ - -WORKDIR ${METAMIGO_DIR} - -USER node - -EXPOSE 3000 -EXPOSE 3001 -EXPOSE 3002 -ENV PORT 3000 -ENV NODE_ENV production - -ARG BUILD_DATE -ARG VCS_REF -ARG VCS_URL="https://gitlab.com/digiresilience/link/metamigo" -ARG VERSION -LABEL org.label-schema.schema-version="1.0" -LABEL org.label-schema.name="digiresilience.org/link/metamigo" -LABEL org.label-schema.description="part of CDR Link" -LABEL org.label-schema.build-date=$BUILD_DATE -LABEL org.label-schema.vcs-url=$VCS_URL -LABEL org.label-schema.vcs-ref=$VCS_REF -LABEL org.label-schema.version=$VERSION - -ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/apps/metamigo-worker/docker-entrypoint.sh b/apps/metamigo-worker/docker-entrypoint.sh deleted file mode 100644 index 9dd4d10..0000000 --- a/apps/metamigo-worker/docker-entrypoint.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -set -e - -cd ${AMIGO_DIR} - -if [[ "$1" == "api" ]]; then - echo "docker-entrypoint: starting api server" - ./cli db -- migrate - exec dumb-init ./cli api -elif [[ "$1" == "worker" ]]; then - echo "docker-entrypoint: starting worker" - exec dumb-init ./cli worker -elif [[ "$1" == "frontend" ]]; then - echo "docker-entrypoint: starting frontend" - exec dumb-init yarn workspace @app/frontend start -elif [[ "$1" == "cli" ]]; then - echo "docker-entrypoint: starting frontend" - shift 1 - exec ./cli "$@" -else - echo "docker-entrypoint: missing argument, one of: api, worker, frontend, cli" - exit 1 -fi