# This dockerfile spins up an instance of tachi-server and *tachi-server* alone. # It does not spin up mongodb instances or redis instances, which the server # does need to boot. You should consider using docker-compose for this. FROM node:16 as build WORKDIR /app ARG COMMIT_HASH ENV COMMIT_HASH=${COMMIT_HASH} COPY --chown=node:node ./server /app/server COPY --chown=node:node ./common /app/common COPY --chown=node:node ./pnpm-lock.yaml /app COPY --chown=node:node ./.npmrc /app COPY --chown=node:node ./pnpm-workspace.yaml /app COPY --chown=node:node ./package.json /app COPY --chown=node:node ./tsconfig.json /app RUN npm install --silent -g pnpm@7 && groupmod -g 1003 node && chown node:node /app USER node WORKDIR /app/server RUN pnpm install --silent && pnpm build && pnpm prune --silent --production && pnpm store prune --silent # no. I have absolutely no idea why either. This is a PNPM bug. # For some reason, if we don't reinstall our dependencies after the pruning, # none of the dependencies for "common/" get saved, resulting in a noncompile. # Amusingly, this command outputs exactly # +1 package installed # but mentions no new installed packages. RUN pnpm install --production HEALTHCHECK --interval=15s --timeout=5s CMD curl -f http://localhost:8080/api/v1/status || exit 1 ENV NODE_PATH=js/ CMD ["pnpm", "start-no-build"]