Files
zkldi_Tachi/Dockerfile.server
T
2022-11-28 00:58:38 +00:00

34 lines
969 B
Docker

# 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-alpine as base
ARG COMMIT_HASH
ENV COMMIT_HASH=${COMMIT_HASH}
RUN npm install --silent -g pnpm
RUN apk add --no-cache
FROM base AS build
WORKDIR /app
COPY pnpm-lock.yaml .
RUN pnpm fetch
COPY . .
RUN pnpm --filter ./common --filter ./server --filter . install --prefer-offline
RUN pnpm --filter ./common --filter ./server build
FROM base AS app
WORKDIR /app
COPY --from=build /app/node_modules /app/node_modules
COPY --from=build /app/server /app/server
COPY --from=build /app/common /app/common
COPY --from=build /app/package.json /app/package.json
HEALTHCHECK --interval=15s --timeout=5s CMD curl -f http://localhost:8080/api/v1/status || exit 1
ENV NODE_PATH=/app/server/js
CMD ["node", "/app/server/js/main.js"]