forked from Cornmeister/CoreScope
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.node
More file actions
37 lines (26 loc) · 1.08 KB
/
Dockerfile.node
File metadata and controls
37 lines (26 loc) · 1.08 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
FROM node:22-alpine
RUN apk add --no-cache mosquitto mosquitto-clients supervisor caddy
WORKDIR /app
# Install Node dependencies
COPY package.json package-lock.json ./
RUN npm ci --production
# Copy application
COPY *.js config.example.json channel-rainbow.json ./
COPY public/ ./public/
# Bake git commit SHA (CI writes .git-commit before build; fallback to "unknown")
COPY .git-commi[t] ./
RUN if [ ! -f .git-commit ]; then echo "unknown" > .git-commit; fi
# Supervisor + Mosquitto + Caddy config
COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY docker/mosquitto.conf /etc/mosquitto/mosquitto.conf
COPY docker/Caddyfile /etc/caddy/Caddyfile
# Create data directory for SQLite + Mosquitto persistence + Caddy certs
RUN mkdir -p /app/data /var/lib/mosquitto /data/caddy && \
chown -R node:node /app/data && \
chown -R mosquitto:mosquitto /var/lib/mosquitto
# Default config: copy example if no config mounted
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
EXPOSE 80 443 1883
VOLUME ["/app/data", "/data/caddy"]
ENTRYPOINT ["/entrypoint.sh"]