Skip to content

Commit

Permalink
Add dockerfile for preview server
Browse files Browse the repository at this point in the history
  • Loading branch information
pipe01 committed Oct 6, 2024
1 parent 302d19f commit 175b011
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git
build
Dockerfile
tools/simulrun/toolchain
frontend/wasm/node_modules
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM ubuntu:22.04 AS builder
RUN apt-get update && apt-get install -y wget git gcc-12 g++ make cmake pkg-config libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libopengl-dev libglx-dev libglu1-mesa-dev freeglut3-dev libxxf86vm-dev

ENV GO_VERSION=1.23.0
RUN wget -qP /tmp "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz"
RUN tar -C /usr/local -xzf "/tmp/go${GO_VERSION}.linux-amd64.tar.gz"
RUN rm "/tmp/go${GO_VERSION}.linux-amd64.tar.gz"
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"

WORKDIR /app
COPY . .
RUN mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j$(nproc) bundling_target

RUN cd frontend/desktop && go build -o /previewer ./cmd/previewer
RUN cd tools/web-previewer && go build -o /preview-server .

FROM ubuntu:22.04 AS runner
WORKDIR /app
RUN apt-get update && apt-get -y install ca-certificates
COPY --from=builder /previewer /preview-server ./

CMD ["/app/preview-server", "-previewer", "/app/previewer"]

0 comments on commit 175b011

Please sign in to comment.