-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (32 loc) · 1.28 KB
/
Dockerfile
File metadata and controls
44 lines (32 loc) · 1.28 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
FROM node:23-alpine
ARG VERSION=development
LABEL Version="${VERSION}" \
Maintainer="H2 invent GmbH" \
Description="LookyLooky Docker Image" \
org.opencontainers.version="${VERSION}" \
org.opencontainers.image.title="LookyLooky Docker Image" \
org.opencontainers.image.license="Business Source License" \
org.opencontainers.image.vendor="H2 invent GmbH" \
org.opencontainers.image.authors="Emanuel Holzmann <support@h2-invent.com>" \
org.opencontainers.image.source="https://github.com/h2-invent/lookylooky" \
org.opencontainers.image.documentation="https://h2-invent.com" \
org.opencontainers.image.url="https://h2-invent.com"
# Setze das Arbeitsverzeichnis im Container-Dateisystem
WORKDIR /usr/src/app
RUN apk --no-cache add \
curl \
&& rm -rf /var/cache/apk/*
# Kopiere die Abhängigkeiten und den Code in das Arbeitsverzeichnis
COPY --chown=nobody . .
# Installiere Development Dependencies
RUN npm install \
&& npm run build \
&& rm -rf node_modules
# Installiere nur Production Dependencies
RUN npm install --only=prod
RUN chmod 755 server.mjs
USER nobody
EXPOSE 3000
HEALTHCHECK --interval=10s --timeout=10s --start-period=30s --retries=5 CMD curl --fail http://localhost:3000 || exit 1
ENV APP_VERSION=${VERSION}
CMD [ "npm", "start" ]