Fixed some bugs and added nix development flake #588 #596 This release also has breaking changes that will need you to replace your docker-compose.yml and .env with the ones included in this release
36 lines
773 B
Docker
36 lines
773 B
Docker
# Dependencies
|
|
FROM node:19-alpine3.17 AS dependencies
|
|
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json ./
|
|
RUN npm install
|
|
|
|
# Build
|
|
FROM node:19-alpine3.17 AS build
|
|
|
|
WORKDIR /app
|
|
COPY --from=dependencies /app/node_modules ./node_modules
|
|
COPY . .
|
|
|
|
RUN npx prisma generate && npm run build
|
|
|
|
# Deploy
|
|
FROM node:19-alpine3.17 as deploy
|
|
|
|
WORKDIR /app
|
|
|
|
ENV NODE_ENV production
|
|
|
|
# Add mysql precheck
|
|
RUN apk add --no-cache mysql-client
|
|
ADD docker-entrypoint.sh /docker-entrypoint.sh
|
|
RUN chmod +x /docker-entrypoint.sh
|
|
|
|
# Copy files
|
|
COPY --from=build /app/package.json ./
|
|
COPY --from=build /app/node_modules ./node_modules
|
|
COPY --from=build /app/prisma ./prisma
|
|
COPY --from=build /app/dist ./dist
|
|
|
|
ENTRYPOINT [ "/docker-entrypoint.sh" ]
|
|
CMD [ "npm", "run", "start:migrate:prod" ]
|