-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathDockerfile
38 lines (27 loc) · 780 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
# Stage 1: Build the application
FROM node:slim AS builder
WORKDIR /app
COPY package*.json ./
RUN npm cache clean --force
RUN npm install
COPY ./ ./
COPY entry.sh ./
# Build the application
RUN npm run build
# Stage 2: Create the production image
FROM node:slim
RUN apt-get update && \
apt-get install -yqq --no-install-recommends wget && \
apt-get autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /app .
COPY --chmod=755 entry.sh /entry.sh
HEALTHCHECK --interval=30s \
--timeout=5s \
--start-period=10s \
--retries=3 \
CMD [ "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/auth/isconfigured" ]
EXPOSE 3000
CMD ["/entry.sh"]