-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (36 loc) · 1.5 KB
/
Copy pathDockerfile
File metadata and controls
47 lines (36 loc) · 1.5 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
# Reality Simulation Code Docker Image
# xaoex/reality-simulation-code
# Production package with full repository contents
FROM node:20-alpine
# Metadata labels
LABEL org.opencontainers.image.source="https://github.com/xaoex/reality-simulation-code"
LABEL org.opencontainers.image.description="Reality Simulation Codebase - SimSim Code & Contributions"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.authors="xaoex <https://linktr.ee/xaoex>"
LABEL org.opencontainers.image.url="https://github.com/xaoex/reality-simulation-code"
LABEL org.opencontainers.image.documentation="https://github.com/xaoex/reality-simulation-code#readme"
LABEL org.opencontainers.image.title="Reality Simulation Code"
LABEL org.opencontainers.image.vendor="xaoex"
# Set environment variables
ENV NODE_ENV=production \
NPM_CONFIG_LOGLEVEL=warn \
REALITY_SIMULATION_VERSION=0.0.1
WORKDIR /app
# Copy package files
COPY package.json ./
# Install dependencies (if any)
RUN npm install --omit=dev --omit=optional --ignore-scripts && \
npm cache clean --force
# Copy full repository content for production package parity
COPY . ./
# Create a non-root user for security
RUN addgroup -g 31337 xaoex 2>/dev/null || addgroup xaoex && \
adduser -D -G xaoex xaoex && \
chown -R xaoex:xaoex /app
# Switch to non-root user
USER xaoex
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD node -e "console.log('healthy')" || exit 1
# Set default command
CMD ["node", "index.js"]