forked from HeliosSoftware/hfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (28 loc) · 1.06 KB
/
Dockerfile
File metadata and controls
41 lines (28 loc) · 1.06 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
FROM debian:bookworm-slim
ARG BINARY_NAME
ARG EXPOSE_PORT=8080
# Validate BINARY_NAME is set
RUN test -n "$BINARY_NAME" || { echo "BINARY_NAME build arg is required"; exit 1; }
# Install runtime dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends libssl3 ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Create non-root user
RUN groupadd -g 1000 hfs && useradd -u 1000 -g hfs -m hfs
WORKDIR /app
# Copy staged build context (binary + optional data files)
COPY . /app/
RUN chmod +x /app/${BINARY_NAME}
# Persist BINARY_NAME for the entrypoint
ENV BINARY_NAME=${BINARY_NAME}
# Create writable data directory for SQLite and other persistent data
RUN mkdir -p /data && chown hfs:hfs /data
VOLUME /data
# Default host binding for all servers (each binary reads only its own env var)
ENV HFS_SERVER_HOST=0.0.0.0
ENV HFS_DATABASE_URL=:memory:
ENV SOF_SERVER_HOST=0.0.0.0
ENV FHIRPATH_SERVER_HOST=0.0.0.0
USER hfs
EXPOSE ${EXPOSE_PORT}
ENTRYPOINT ["sh", "-c", "exec /app/${BINARY_NAME} \"$@\"", "--"]