Skip to content

Commit

Permalink
go back to what we had
Browse files Browse the repository at this point in the history
  • Loading branch information
k2xl committed Jan 29, 2024
1 parent 6611dbe commit 846bfc5
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 16 deletions.
13 changes: 0 additions & 13 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,6 @@ jobs:
GITHUB_RUN_NUMBER: ${{ github.run_number }}
run: echo "::set-output name=version::$(date +'%Y-%m-%d').$GITHUB_RUN_NUMBER"

# - name: Build and Push Base Image
# if: github.ref == 'refs/heads/main'
# uses: docker/build-push-action@v4
# with:
# context: .
# file: Dockerfile
# load: false
# cache-from: type=gha
# cache-to: type=gha,mode=max
# tags: ${{ secrets.DOCKERHUB_USERNAME }}/pathology:base
# target: base
# push: true

- name: Build container image and push to Docker Hub
uses: docker/build-push-action@v4
with:
Expand Down
34 changes: 31 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
# First Stage: Setup the base environment
FROM duceswild99/pathology:base
FROM node:20 AS base

# for web app
WORKDIR /thinky_app

ENV NEXT_TELEMETRY_DISABLED=1
ENV NEW_RELIC_LOG_ENABLED=false
ENV NEW_RELIC_ERROR_COLLECTOR_IGNORE_ERROR_CODES="404,401"
ARG NEW_RELIC_LICENSE_KEY=dummy
ARG NEW_RELIC_APP_NAME=dummy
# avoid using the db when building pages
ARG OFFLINE_BUILD=true

RUN npm config set fund false

WORKDIR /thinky_app

# ts-node / tspath is needed for other scripts right now. module-alias is used for socket server production
# ideally all would use package module alias and we would not need ts-node / tspath. but that's a TODO
RUN npm install -g ts-node typescript module-alias

COPY --chown=node:node package*.json ./

RUN npm install --platform=linux --arch=x64 sharp
RUN npm install --platform=linuxmusl

# HERE IS WHERE WE WANT TO END WHERE THE BASE IMAGE IS
COPY --chown=node:node . .

FROM base AS final

# for web app. this step takes approx 83s on github runner
RUN npm run build --omit=dev
# we may need the following to prevent `Failed to write image to cache` errors
RUN chown -R node:node .next/

# for socket server
# for socket server. this command takes appro 14s on github runner
RUN tsc -p tsconfig-socket.json

USER node
Expand Down

0 comments on commit 846bfc5

Please sign in to comment.