diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 2e76c91..482b97c 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -48,12 +48,6 @@ jobs: registry: ${{ env.ECR_REPOSITORY_URL}} repository: ${{ env.ECR_REPOSITORY_NAME }} tag: ${{ env.TAG }} - - name: 🏗️ Install Dependencies - run: | - npm install - - name: 📦 Compile Mina Transactions Generator - run: | - npm run build - name: 🛠️ Build Mina Transactions Generator Docker Image if: steps.checktag.outputs.tag == 'not found' run: DOCKER_BUILDKIT=1 docker build -t ${{ env.ECR_REPOSITORY_URL}}/${{ env.ECR_REPOSITORY_NAME }}:${{ env.TAG }} . diff --git a/Dockerfile b/Dockerfile index 4956e74..0224b9a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,20 @@ -FROM node:alpine +FROM node:alpine as build WORKDIR /usr/src/app -COPY package*.json ./ +COPY package*.json tsconfig.json ./ +COPY src ./src + +RUN npm install && npm run build + +FROM node:alpine + +WORKDIR /app + +COPY --from=build /usr/src/app/build ./ + +COPY --from=build /usr/src/app/package*.json ./ -COPY ./build ./ +RUN npm install -CMD ["node", "./src/entry.js"] +CMD ["node", "./entry.js"] diff --git a/tsconfig.json b/tsconfig.json index ec3b101..de5d2ee 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ "module": "es2022", "lib": ["dom", "esnext"], "outDir": "./build", - "rootDir": ".", + "rootDir": "./src", "strict": true, "strictPropertyInitialization": false, // to enable generic constructors, e.g. on CircuitValue "skipLibCheck": true,