forked from AI-READI/logwatch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 lines (33 loc) · 1.1 KB
/
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
42
43
44
45
46
47
48
49
# 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" ]
# RUN echo '#!/bin/sh' > /app/start.sh && \
# echo 'exec node /app/server/index.mjs' >> /app/start.sh && \
# chmod +x /app/start.sh
# EXPOSE 3000
# CMD ["/bin/sh", "/app/start.sh"]