diff --git a/.github/workflows/deploy_gcp.yaml b/.github/workflows/deploy_gcp.yaml index 70185433..335f32fb 100644 --- a/.github/workflows/deploy_gcp.yaml +++ b/.github/workflows/deploy_gcp.yaml @@ -1,4 +1,4 @@ -name: Polygon Webflow APIs +name: Polygon Tokenlist api GCP docker publish image on: push: branches: @@ -15,7 +15,7 @@ jobs: if: | (github.event_name == 'push' && github.ref == 'refs/heads/dev') || (github.event_name == 'push' && github.ref == 'refs/heads/master') - uses: ./.github/workflows/docker_publish_gcp.yaml + uses: 0xPolygon/pipelines/.github/workflows/gcp_pipeline_release_image.yaml@main with: - core_app: api-polygon-tokens - environment: ${{ (github.ref == 'refs/heads/dev' && 'dev') || (github.ref == 'refs/heads/master' && 'prod') }} \ No newline at end of file + image_name: api-polygon-tokens + environment: ${{ (github.ref == 'refs/heads/dev' && 'dev') || (github.ref == 'refs/heads/master' && 'prod') }} diff --git a/.github/workflows/ecs_prod.yml b/.github/workflows/ecs_prod.yml index 06e6e26c..c9e8cfed 100644 --- a/.github/workflows/ecs_prod.yml +++ b/.github/workflows/ecs_prod.yml @@ -23,13 +23,6 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 - # Runs a set of commands using the runners shell - - name: Install dependencies - run: npm ci - - - name: Build tokenlists - run: npm run build - - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v2 with: diff --git a/Dockerfile b/Dockerfile index bb11f9e0..cea5c95a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,18 @@ -#Serve the app with NGINX +# Builder stage +FROM node:18 AS builder + +WORKDIR /app +COPY package*.json ./ +RUN npm ci + +COPY . . +RUN npm run build + +# Final stage (Nginx) FROM nginx:alpine -# Copy the build files from the dist folder to /usr/share/nginx/html -COPY build /usr/share/nginx/html +COPY --from=builder /app/build /usr/share/nginx/html COPY nginx.conf /etc/nginx/conf.d/default.conf - -# Expose the desired port (default is 80 for NGINX) EXPOSE 3000 -# Start NGINX CMD ["nginx", "-g", "daemon off;"]