forked from the-open-agent/openagent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgo-dockerfile
More file actions
26 lines (26 loc) · 962 Bytes
/
Copy pathgo-dockerfile
File metadata and controls
26 lines (26 loc) · 962 Bytes
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
FROM golang:1.17-rc-buster
WORKDIR /casnode
COPY ./ /casnode
RUN go env -w CGO_ENABLED=0 GOPROXY=https://goproxy.io,direct GOOS=linux GOARCH=amd64 \
&& apt update && apt install sudo \
&& wget https://nodejs.org/dist/v12.22.0/node-v12.22.0-linux-x64.tar.gz \
&& sudo tar xf node-v12.22.0-linux-x64.tar.gz \
&& sudo apt install wait-for-it
ENV PATH=$PATH:/casnode/node-v12.22.0-linux-x64/bin
RUN npm install -g yarn \
&& cd web \
&& yarn install \
&& yarn run build \
&& rm -rf node_modules \
&& cd /casnode \
&& go build main.go
FROM golang:alpine3.14
COPY --from=0 /casnode /casnode
COPY --from=0 /usr/bin/wait-for-it /casnode
RUN go env -w CGO_ENABLED=0 GOPROXY=https://goproxy.io,direct \
&& set -eux \
&& sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories \
&& apk update \
&& apk upgrade \
&& apk add bash coreutils
CMD cd /casnode && ./wait-for-it db:3306 && ./main