refactor: refactor docker process

This commit is contained in:
lbaf23 2021-07-29 11:25:48 +08:00
parent 31a9d3b860
commit 99d3963b97
1 changed files with 8 additions and 8 deletions

View File

@ -1,19 +1,19 @@
FROM golang:1.16-rc-buster
WORKDIR /openpbl
COPY ./ /openpbl
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:/openpbl/node-v12.22.0-linux-x64/bin
RUN npm install -g yarn \
&& cd openpbl-landing \
&& yarn install \
&& yarn run build \
&& rm -rf node_modules \
&& cd /openpbl \
&& go build main.go
RUN npm install -g yarn
COPY openpbl-landing/package.json /openpbl/openpbl-landing/package.json
RUN cd openpbl-landing && yarn install
COPY ./ /openpbl
RUN cd openpbl-landing && yarn build && rm -rf node_modules
RUN cd /openpbl && go build main.go
FROM alpine:3.7