-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathDockerfile
More file actions
63 lines (46 loc) · 1.9 KB
/
Dockerfile
File metadata and controls
63 lines (46 loc) · 1.9 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
FROM node:22-alpine AS build
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile --network-timeout 600000
COPY . .
RUN yarn build
FROM node:22-alpine AS deps
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --production --frozen-lockfile --network-timeout 600000 \
&& yarn cache clean
FROM node:22-alpine
ARG VERSION=dev
ARG REVISION
ARG CREATED
LABEL org.opencontainers.image.title="Dashy" \
org.opencontainers.image.description="The self-hosted dashboard" \
org.opencontainers.image.url="https://dashy.to" \
org.opencontainers.image.documentation="https://dashy.to/docs" \
org.opencontainers.image.source="https://github.com/lissy93/dashy" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.authors="Alicia Sykes <alicia@omg.lol>" \
org.opencontainers.image.vendor="Alicia Sykes" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.revision="${REVISION}" \
org.opencontainers.image.created="${CREATED}"
ENV NODE_ENV=production \
IS_DOCKER=true \
PORT=8080 \
HOST=0.0.0.0
WORKDIR /app
RUN apk add --no-cache tzdata tini
COPY --chown=node:node --from=deps /app/node_modules ./node_modules
COPY --chown=node:node --from=build /app/dist ./dist
COPY --chown=node:node --from=build /app/public ./public
COPY --chown=node:node --from=build /app/services ./services
COPY --chown=node:node --from=build /app/src/utils/config/ConfigSchema.json ./src/utils/config/ConfigSchema.json
COPY --chown=node:node --from=build /app/server.js ./server.js
COPY --chown=node:node --from=build /app/package.json ./package.json
COPY --chown=node:node --from=build /app/user-data/conf.yml ./user-data/conf.yml
USER node
EXPOSE 8080
HEALTHCHECK --interval=5m --timeout=10s --start-period=20s --retries=3 \
CMD node services/healthcheck.js
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["node", "server.js"]