-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (37 loc) · 1.64 KB
/
Copy pathDockerfile
File metadata and controls
47 lines (37 loc) · 1.64 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
# Stage 1: Build native modules
FROM node:24-alpine AS builder
WORKDIR /app
# Install build dependencies for native modules (bcrypt, sqlite3)
RUN apk add --no-cache python3 make g++
# Install app dependencies
COPY package*.json ./
RUN npm ci --omit=dev
# Stage 2: Runtime image (no build tools)
FROM node:24-alpine
WORKDIR /app
# Copy installed node_modules from builder
COPY --from=builder /app/node_modules ./node_modules
# Bundle app source
COPY package*.json ./
COPY . .
# Define build arguments for provenance. VERSION is also handed to the running
# server as APP_VERSION; the three of them become OCI labels so that the image
# itself says which release it is, which is what links the package to this repo
# on GHCR and what `docker inspect` reports.
ARG VERSION=development
ARG REVISION=unknown
ARG CREATED=unknown
ENV APP_VERSION=$VERSION
LABEL org.opencontainers.image.title="FHIRsmith" \
org.opencontainers.image.description="A Node.js server that provides a collection of tools to serve the FHIR ecosystem" \
org.opencontainers.image.vendor="Health Intersections Pty Ltd" \
org.opencontainers.image.licenses="BSD-3-Clause" \
org.opencontainers.image.url="https://github.com/HealthIntersections/fhirsmith" \
org.opencontainers.image.source="https://github.com/HealthIntersections/fhirsmith" \
org.opencontainers.image.documentation="https://github.com/HealthIntersections/fhirsmith#readme" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.revision="${REVISION}" \
org.opencontainers.image.created="${CREATED}"
# Expose port and define command
EXPOSE 3000
CMD ["node", "server.js"]