Skip to content

Commit 1c8fb26

Browse files
committed
add Dockerfile
1 parent af8ff56 commit 1c8fb26

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM golang:1.20-alpine as build
2+
3+
WORKDIR /build/
4+
COPY ./webtex_api ./webtex_api
5+
COPY ./webtex_render ./webtex_render
6+
COPY ./webtex_web ./webtex_web
7+
COPY go.mod go.sum ./
8+
9+
RUN go build -o wr ./webtex_render
10+
RUN go build -o wr_web ./webtex_web
11+
12+
FROM texlive/texlive:latest
13+
RUN adduser texuser
14+
USER texuser
15+
16+
WORKDIR /app
17+
COPY --from=build /build/wr /app/wr
18+
COPY --from=build /build/wr_web /app/wr_web
19+
CMD ["/app/wr_web"]

webtex_web/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ func main() {
6363
panic(err)
6464
}
6565

66+
gin.SetMode(gin.ReleaseMode)
67+
6668
r := gin.Default()
6769
r.GET("/", getRoot)
6870
r.GET("/render/:renderer/", getRender)

0 commit comments

Comments
 (0)