This commit is contained in:
Sotig
2026-03-21 15:35:50 +02:00
commit 07cd9ebac9
10 changed files with 259 additions and 0 deletions

39
docker/Dockerfile Normal file
View File

@@ -0,0 +1,39 @@
FROM ubuntu:plucky
RUN echo "deb https://ppa.launchpadcontent.net/longsleep/golang-backports/ubuntu ubuntu-plucky main" | tee /etc/apt/sources.list.d/docker.list
RUN apt update
ENV GO_VERSION=1.24
RUN apt install -y golang-${GO_VERSION}
RUN ln -s "/usr/lib/go-${GO_VERSION}/bin/go" /usr/local/bin/
RUN apt-get clean && apt-get update && apt-get install -y locales wget
RUN locale-gen en_US.UTF-8
RUN update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LC_CTYPE="en_US.UTF-8"
ENV LC_NUMERIC="en_US.UTF-8"
ENV LC_TIME="en_US.UTF-8"
ENV LC_COLLATE="en_US.UTF-8"
ENV LC_MONETARY="en_US.UTF-8"
ENV LC_MESSAGES="en_US.UTF-8"
ENV LC_PAPER="en_US.UTF-8"
ENV LC_NAME="en_US.UTF-8"
ENV LC_ADDRESS="en_US.UTF-8"
ENV LC_TELEPHONE="en_US.UTF-8"
ENV LC_MEASUREMENT="en_US.UTF-8"
ENV LC_IDENTIFICATION="en_US.UTF-8"
ENV LC_ALL=
RUN apt install -y prusa-slicer
WORKDIR /build
COPY ../ .
RUN go build -o /bin/slic3r-api ./cmd
RUN rm -rf /build/*
CMD [ "/bin/slic3r-api" ]

15
docker/docker-compose.yml Normal file
View File

@@ -0,0 +1,15 @@
services:
slic3r-api:
build:
context: ../
dockerfile: docker/Dockerfile
command: /bin/bash -c "cd /src && go run ./cmd"
volumes:
- ../:/src
- ../configs:/configs
environment:
- PORT=3030
- HOST=0.0.0.0
- CONFIGS=/configs/
ports:
- 3030:3030