forked from sparkoo/csgo-2d-demo-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (28 loc) · 942 Bytes
/
Dockerfile
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
FROM golang:1.18 as builderGo
USER root
WORKDIR /csgo-2d-demo-player
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build \
-a -o _output/main \
-gcflags all=-trimpath=/ \
-asmflags all=-trimpath=/ \
main.go
FROM node:lts-slim as builderNpm
USER root
WORKDIR /csgo-2d-demo-player
COPY web/player/package.json .
COPY web/player/package-lock.json .
RUN npm install
COPY web/player/public public
COPY web/player/src src
RUN npm run build
FROM debian:buster-slim
COPY --from=builderGo /csgo-2d-demo-player/_output/main /csgo-2d-demo-player/
COPY --from=builderGo /csgo-2d-demo-player/templates/ /csgo-2d-demo-player/templates/
COPY --from=builderGo /csgo-2d-demo-player/assets/ /csgo-2d-demo-player/assets/
COPY --from=builderNpm /csgo-2d-demo-player/build/ /csgo-2d-demo-player/web/player/build/
WORKDIR /csgo-2d-demo-player
CMD /csgo-2d-demo-player/main