-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
63 lines (47 loc) · 1.96 KB
/
Copy pathDockerfile
File metadata and controls
63 lines (47 loc) · 1.96 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
63
ARG ORCA_VERSION=2.4.1
FROM golang:1.23-bookworm AS build
WORKDIR /src
COPY go.mod ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/orca-slicer-api ./cmd/server
FROM ubuntu:24.04 AS orca
ARG ORCA_VERSION
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl fuse file libopengl0 libglu1-mesa libgl1 libglx0 libegl1 libglvnd0 libsm6 libxext6 libxrender1 \
&& update-ca-certificates \
&& curl -L -o /tmp/orca.AppImage "https://github.com/SoftFever/OrcaSlicer/releases/download/v${ORCA_VERSION}/OrcaSlicer_Linux_AppImage_Ubuntu2404_V${ORCA_VERSION}.AppImage" \
&& chmod +x /tmp/orca.AppImage \
&& cd /tmp \
&& /tmp/orca.AppImage --appimage-extract \
&& rm /tmp/orca.AppImage \
&& rm -rf /var/lib/apt/lists/*
FROM ubuntu:24.04
ARG ORCA_VERSION
LABEL org.opencontainers.image.title="Orca Slicer API"
LABEL org.opencontainers.image.description="REST API em Go para controlar OrcaSlicer CLI"
LABEL org.opencontainers.image.source="https://github.com/Brook-sys/orca-slicer-api"
LABEL org.opencontainers.image.vendor="Brook-sys"
LABEL org.opencontainers.image.orca.version="${ORCA_VERSION}"
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates curl \
libopengl0 libglu1-mesa \
libgl1 libgl1-mesa-dri libglx0 libegl1 libglvnd0 \
libsm6 libxext6 libxrender1 \
libgtk-3-0 \
libgstreamer1.0-0 libgstreamer-plugins-base1.0-0 \
libwebkit2gtk-4.1-0 \
&& update-ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /out/orca-slicer-api /app/orca-slicer-api
COPY --from=orca /tmp/squashfs-root /app/squashfs-root
ENV PORT=3000
ENV DATA_PATH=/app/data
ENV ORCASLICER_PATH=/app/squashfs-root/AppRun
ENV ORCA_PROFILES_PATH=/app/squashfs-root/resources/profiles
ENV ORCA_VERSION=${ORCA_VERSION}
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD curl -f http://localhost:3000/health || exit 1
CMD ["/app/orca-slicer-api"]