Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (52 loc) · 2.23 KB
/
Copy pathDockerfile
File metadata and controls
62 lines (52 loc) · 2.23 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
FROM --platform=$BUILDPLATFORM node:22-bookworm-slim AS console-assets
WORKDIR /build/rustpbx/frontend
COPY frontend/ ./
RUN --mount=type=cache,target=/root/.npm npm ci --ignore-scripts --no-audit --no-fund
COPY templates/ /build/rustpbx/templates/
COPY src/addons/ /build/rustpbx/src/addons/
COPY static/ /build/rustpbx/static/
RUN npm run build
FROM debian:trixie-slim
LABEL maintainer="shenjindi@miuda.ai"
LABEL org.opencontainers.image.source="https://github.com/restsend/rustpbx"
LABEL org.opencontainers.image.description="A SIP PBX implementation in Rust"
# Set environment variables
ARG DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
ENV TZ=UTC
# Install runtime dependencies
RUN --mount=type=cache,target=/var/cache/apt \
apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
tzdata
# Create application directory structure
WORKDIR /app
RUN mkdir -p /app/config /app/sounds /app/templates
# Automatically pick the correct binary based on the architecture being built
# We expect binaries to be placed in bin/amd64/ and bin/arm64/ by the build script
ARG TARGETARCH
COPY --chmod=0755 bin/${TARGETARCH}/rustpbx /app/rustpbx
COPY --chmod=0755 bin/${TARGETARCH}/sipflow /app/sipflow
RUN mkdir -p /app/config
# Copy static resources
COPY ./static /app/static
COPY --from=console-assets /build/rustpbx/static/css /app/static/css
COPY --from=console-assets /build/rustpbx/static/vendor /app/static/vendor
COPY ./templates /app/templates
COPY ./locales /app/locales
COPY ./config/sounds /app/config/sounds
RUN ln -s /app/config/sounds /app/sounds
# Copy addon static and templates
COPY ./src/addons/acme/static /app/static/acme
COPY ./src/addons/transcript/static /app/static/transcript
COPY ./src/addons/queue/static /app/static/queue
COPY ./src/addons/acme/templates /app/templates/acme
COPY ./src/addons/archive/templates /app/templates/archive
COPY ./src/addons/queue/templates /app/templates/queue
COPY ./src/addons/transcript/templates /app/templates/transcript
# Copy addon locales
COPY ./src/addons/acme/locales /app/locales/acme
COPY ./src/addons/archive/locales /app/locales/archive
COPY ./src/addons/queue/locales /app/locales/queue
COPY ./src/addons/transcript/locales /app/locales/transcript
ENTRYPOINT ["/app/rustpbx"]