You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
837 B
Docker

FROM node:18-alpine AS builder
WORKDIR "/app"
COPY . .
RUN npm ci
RUN npm run build
RUN npm prune --production
FROM node:18-alpine AS prod
WORKDIR "/app"
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/package-lock.json ./package-lock.json
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/sf-class2-root.crt ./sf-class2-root.crt
COPY --from=builder /app/.env /app/dist/.env
ENV ENVIRONMENT production
ENV CASSANDRA_DC datacenter1
ENV CASSANDRA_HOST 0.0.0.0
ENV CASSANDRA_USER cassandra
ENV CASSANDRA_PW cassandra
CMD ["sh", "-c", "ENVIRONMENT=${ENVIRONMENT} CASSANDRA_DC=${CASSANDRA_DC} CASSANDRA_HOST=${CASSANDRA_HOST} CASSANDRA_USER=${CASSANDRA_USER} CASSANDRA_PW=${CASSANDRA_PW} npm run start:prod --host 0.0.0.0"]
EXPOSE 3000