forked from fairdataihub/logwatch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (28 loc) · 941 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Build stage
FROM node:20-alpine AS builder
# Use alpine-based image and install only necessary dependencies
RUN apk add --no-cache openssl
WORKDIR /app
# Only needed for prisma build
ARG DATABASE_URL
# Copy only necessary files for dependency installation
COPY package.json yarn.lock ./
COPY prisma ./prisma/
RUN yarn install --frozen-lockfile \
&& yarn prisma:generate \
&& yarn cache clean
# Copy source files and build
COPY . .
RUN yarn run build
# Production stage
FROM node:20-alpine
LABEL maintainer="FAIR Data Innovations Hub <[email protected]>" \
description="A better log watcher!"
RUN apk add --no-cache openssl
WORKDIR /app
# Copy only the necessary files from builder stage
COPY --from=builder /app/.output ./
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
COPY --from=builder /app/node_modules/@prisma ./node_modules/@prisma
EXPOSE 3000
CMD [ "node", "/app/server/index.mjs" ]