juzhiyuan commented on a change in pull request #657:
URL: https://github.com/apache/apisix-dashboard/pull/657#discussion_r515754266



##########
File path: Dockerfile
##########
@@ -0,0 +1,62 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+FROM golang:1.14 as api-builder
+
+WORKDIR /go/src/app
+
+COPY ./api .
+
+RUN mkdir -p /go/output/conf \
+    && cp ./conf/*.json /go/output/conf
+
+RUN wget https://github.com/api7/dag-to-lua/archive/v1.1.tar.gz \
+    && tar -zxvf v1.1.tar.gz \
+    && mkdir -p /go/output/dag-to-lua \
+    && mv -u ./dag-to-lua-1.1/lib/* /go/output/dag-to-lua/
+
+RUN go build -o /go/output/manager-api .

Review comment:
       Not sure, cc @nic-chen 

##########
File path: docs/deploy-with-docker.zh-CN.md
##########
@@ -0,0 +1,36 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+# 使用 Docker 部署
+
+1. 构建镜像
+
+```sh
+$ docker build -t apisix-dashboard:2.0-rc3 .

Review comment:
       CI passed and working on my side.

##########
File path: Dockerfile
##########
@@ -0,0 +1,59 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+FROM golang:1.14 as api-builder
+
+WORKDIR /go/src/app

Review comment:
       
![image](https://user-images.githubusercontent.com/2106987/97848297-d5a39980-1d2b-11eb-9016-c007a39b390a.png)
   
   No, just adapted from Dockerhub

##########
File path: Dockerfile
##########
@@ -0,0 +1,59 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+FROM golang:1.14 as api-builder
+
+WORKDIR /go/src/app
+
+COPY ./api .
+
+RUN mkdir -p /go/output/conf \

Review comment:
       Just the same as 
https://github.com/apache/apisix-dashboard/pull/657#discussion_r515819842

##########
File path: Dockerfile
##########
@@ -0,0 +1,59 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+FROM golang:1.14 as api-builder
+
+WORKDIR /go/src/app
+
+COPY ./api .
+
+RUN mkdir -p /go/output/conf \
+    && cp ./conf/*.json /go/output/conf
+
+RUN wget https://github.com/api7/dag-to-lua/archive/v1.1.tar.gz \
+    && tar -zxvf v1.1.tar.gz \
+    && mkdir -p /go/output/dag-to-lua \
+    && mv -u ./dag-to-lua-1.1/lib/* /go/output/dag-to-lua/
+
+RUN go env -w GO111MODULE=on \
+    && go env -w GOPROXY=https://goproxy.io,direct \
+    && go build -o /go/output/manager-api .
+
+FROM node:14-alpine as fe-builder
+
+WORKDIR /frontend/app

Review comment:
       Just the same as Golang

##########
File path: Dockerfile
##########
@@ -0,0 +1,59 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+FROM golang:1.14 as api-builder
+
+WORKDIR /go/src/app
+
+COPY ./api .
+
+RUN mkdir -p /go/output/conf \
+    && cp ./conf/*.json /go/output/conf
+
+RUN wget https://github.com/api7/dag-to-lua/archive/v1.1.tar.gz \
+    && tar -zxvf v1.1.tar.gz \
+    && mkdir -p /go/output/dag-to-lua \
+    && mv -u ./dag-to-lua-1.1/lib/* /go/output/dag-to-lua/
+
+RUN go env -w GO111MODULE=on \
+    && go env -w GOPROXY=https://goproxy.io,direct \
+    && go build -o /go/output/manager-api .

Review comment:
       Just modifies the Golang part in the Dockerfile please, I'm not familiar 
with Golang.

##########
File path: Dockerfile
##########
@@ -0,0 +1,59 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+FROM golang:1.14 as api-builder
+
+WORKDIR /go/src/app
+
+COPY ./api .
+
+RUN mkdir -p /go/output/conf \
+    && cp ./conf/*.json /go/output/conf
+
+RUN wget https://github.com/api7/dag-to-lua/archive/v1.1.tar.gz \
+    && tar -zxvf v1.1.tar.gz \
+    && mkdir -p /go/output/dag-to-lua \
+    && mv -u ./dag-to-lua-1.1/lib/* /go/output/dag-to-lua/
+
+RUN go env -w GO111MODULE=on \
+    && go env -w GOPROXY=https://goproxy.io,direct \
+    && go build -o /go/output/manager-api .

Review comment:
       Just to modify the Golang part in the Dockerfile please, I'm not 
familiar with Golang.

##########
File path: Dockerfile
##########
@@ -0,0 +1,59 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+FROM golang:1.14 as api-builder
+
+WORKDIR /go/src/app
+
+COPY ./api .

Review comment:
       Let's download codes from the target release first, then Build & Deploy 
in multiple stages.

##########
File path: Dockerfile
##########
@@ -0,0 +1,59 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+FROM golang:1.14 as api-builder
+
+WORKDIR /go/src/app
+
+COPY ./api .

Review comment:
       Let me resolve this conversation first.

##########
File path: docs/deploy-with-docker.zh-CN.md
##########
@@ -0,0 +1,36 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+# 使用 Docker 部署
+
+1. 构建镜像
+
+```sh
+$ docker build -t apisix-dashboard:2.0-rc3 .

Review comment:
       It's working but I will update it to `docker build -t 
apisix-dashboard:{$tag} .`

##########
File path: Dockerfile
##########
@@ -0,0 +1,59 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+FROM golang:1.14 as api-builder
+
+WORKDIR /go/src/app
+
+COPY ./api .
+
+RUN mkdir -p /go/output/conf \
+    && cp ./conf/*.json /go/output/conf
+
+RUN wget https://github.com/api7/dag-to-lua/archive/v1.1.tar.gz \
+    && tar -zxvf v1.1.tar.gz \
+    && mkdir -p /go/output/dag-to-lua \
+    && mv -u ./dag-to-lua-1.1/lib/* /go/output/dag-to-lua/
+
+RUN go env -w GO111MODULE=on \
+    && go env -w GOPROXY=https://goproxy.io,direct \
+    && go build -o /go/output/manager-api .

Review comment:
       If I add CGO_ENABLED=0, then an error will occur.

##########
File path: Dockerfile
##########
@@ -0,0 +1,77 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+FROM alpine:latest as pre-build
+
+ARG APISIX_DASHBOARD_VERSION=v2.0
+
+RUN set -x \
+    && wget 
https://github.com/apache/apisix-dashboard/archive/${APISIX_DASHBOARD_VERSION}.tar.gz
 -O /tmp/apisix-dashboard.tar.gz \

Review comment:
       I'm not sure if it's ok to download codes from the target branch/tag 🤔 
cc @moonming @membphis 

##########
File path: Dockerfile
##########
@@ -0,0 +1,77 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+FROM alpine:latest as pre-build
+
+ARG APISIX_DASHBOARD_VERSION=v2.0
+
+RUN set -x \
+    && wget 
https://github.com/apache/apisix-dashboard/archive/${APISIX_DASHBOARD_VERSION}.tar.gz
 -O /tmp/apisix-dashboard.tar.gz \

Review comment:
       This line looks good to me IMO.

##########
File path: Dockerfile
##########
@@ -0,0 +1,77 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+FROM alpine:latest as pre-build
+
+ARG APISIX_DASHBOARD_VERSION=v2.0
+
+RUN set -x \
+    && wget 
https://github.com/apache/apisix-dashboard/archive/${APISIX_DASHBOARD_VERSION}.tar.gz
 -O /tmp/apisix-dashboard.tar.gz \
+    && mkdir /usr/local/apisix-dashboard \
+    && tar -xvf /tmp/apisix-dashboard.tar.gz -C /usr/local/apisix-dashboard 
--strip 1
+
+FROM golang:1.14 as api-builder
+
+ARG ENABLE_PROXY=false
+
+WORKDIR /usr/local/apisix-dashboard
+
+COPY --from=pre-build /usr/local/apisix-dashboard .
+
+WORKDIR /usr/local/apisix-dashboard/api
+
+RUN mkdir -p ../output/conf \
+    && cp ./conf/*.json ../output/conf
+
+RUN wget https://github.com/api7/dag-to-lua/archive/v1.1.tar.gz -O 
/tmp/v1.1.tar.gz \
+    && mkdir /tmp/dag-to-lua \
+    && tar -xvf /tmp/v1.1.tar.gz -C /tmp/dag-to-lua --strip 1 \
+    && mkdir -p ../output/dag-to-lua \
+    && mv /tmp/dag-to-lua/lib/* ../output/dag-to-lua/
+
+RUN if [ "$ENABLE_PROXY" = "true" ] ; then go env -w 
GOPROXY=https://goproxy.io,direct ; fi
+
+RUN go env -w GO111MODULE=on \
+    && go build -o ../output/manager-api .

Review comment:
       Just ping @nic-chen to help check & modify the Golang part.
   
   
https://github.com/apache/apisix-dashboard/pull/657/files#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557R26-R48

##########
File path: Dockerfile
##########
@@ -0,0 +1,77 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+FROM alpine:latest as pre-build
+
+ARG APISIX_DASHBOARD_VERSION=v2.0
+
+RUN set -x \
+    && wget 
https://github.com/apache/apisix-dashboard/archive/${APISIX_DASHBOARD_VERSION}.tar.gz
 -O /tmp/apisix-dashboard.tar.gz \
+    && mkdir /usr/local/apisix-dashboard \
+    && tar -xvf /tmp/apisix-dashboard.tar.gz -C /usr/local/apisix-dashboard 
--strip 1
+
+FROM golang:1.14 as api-builder
+
+ARG ENABLE_PROXY=false
+
+WORKDIR /usr/local/apisix-dashboard
+
+COPY --from=pre-build /usr/local/apisix-dashboard .
+
+WORKDIR /usr/local/apisix-dashboard/api
+
+RUN mkdir -p ../output/conf \
+    && cp ./conf/*.json ../output/conf
+
+RUN wget https://github.com/api7/dag-to-lua/archive/v1.1.tar.gz -O 
/tmp/v1.1.tar.gz \
+    && mkdir /tmp/dag-to-lua \
+    && tar -xvf /tmp/v1.1.tar.gz -C /tmp/dag-to-lua --strip 1 \
+    && mkdir -p ../output/dag-to-lua \
+    && mv /tmp/dag-to-lua/lib/* ../output/dag-to-lua/
+
+RUN if [ "$ENABLE_PROXY" = "true" ] ; then go env -w 
GOPROXY=https://goproxy.io,direct ; fi
+
+RUN go env -w GO111MODULE=on \
+    && go build -o ../output/manager-api .

Review comment:
       Error: 
https://github.com/apache/apisix-dashboard/pull/657#issuecomment-720063017
   

##########
File path: docs/deploy-with-docker.zh-CN.md
##########
@@ -0,0 +1,42 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+# 使用 Docker 部署
+
+1. 构建镜像
+
+```sh
+# 注意:需手动指定 $tag
+$ docker build -t apisix-dashboard:{$tag} .

Review comment:
       We don't have a stable tag now, waiting for RC3 to release.

##########
File path: Dockerfile
##########
@@ -0,0 +1,83 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+FROM alpine:latest as pre-build
+
+ARG APISIX_DASHBOARD_VERSION=v2.0
+
+RUN set -x \
+    && wget 
https://github.com/apache/apisix-dashboard/archive/${APISIX_DASHBOARD_VERSION}.tar.gz
 -O /tmp/apisix-dashboard.tar.gz \
+    && mkdir /usr/local/apisix-dashboard \
+    && tar -xvf /tmp/apisix-dashboard.tar.gz -C /usr/local/apisix-dashboard 
--strip 1
+
+FROM golang:1.14 as api-builder
+
+ARG ENABLE_PROXY=false
+
+WORKDIR /usr/local/apisix-dashboard
+
+COPY --from=pre-build /usr/local/apisix-dashboard .
+
+WORKDIR /usr/local/apisix-dashboard/api
+
+RUN mkdir -p ../output/conf \
+    && cp ./conf/*.json ../output/conf
+
+RUN wget https://github.com/api7/dag-to-lua/archive/v1.1.tar.gz -O 
/tmp/v1.1.tar.gz \
+    && mkdir /tmp/dag-to-lua \
+    && tar -xvf /tmp/v1.1.tar.gz -C /tmp/dag-to-lua --strip 1 \
+    && mkdir -p ../output/dag-to-lua \
+    && mv /tmp/dag-to-lua/lib/* ../output/dag-to-lua/
+
+RUN if [ "$ENABLE_PROXY" = "true" ] ; then go env -w 
GOPROXY=https://goproxy.io,direct ; fi
+
+RUN go env -w GO111MODULE=on \
+    && CGO_ENABLED=0 go build -o ../output/manager-api .
+
+FROM node:14-alpine as fe-builder
+
+ARG ENABLE_PROXY=false
+
+WORKDIR /usr/local/apisix-dashboard
+
+COPY --from=pre-build /usr/local/apisix-dashboard .
+
+WORKDIR /usr/local/apisix-dashboard/frontend
+
+RUN if [ "$ENABLE_PROXY" = "true" ] ; then yarn config set registry 
https://registry.npm.taobao.org/ ; fi
+
+RUN yarn install
+
+RUN yarn build
+
+FROM alpine:latest as prod
+
+ARG ENABLE_PROXY=false
+
+RUN if [ "$ENABLE_PROXY" = "true" ] ; then sed -i 
's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories ; fi

Review comment:
       Added those lines to speed up Dependency Downloading.

##########
File path: Dockerfile
##########
@@ -0,0 +1,86 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+FROM alpine:latest as pre-build
+
+ARG APISIX_DASHBOARD_VERSION=v2.0
+
+RUN set -x \
+    && wget 
https://github.com/apache/apisix-dashboard/archive/${APISIX_DASHBOARD_VERSION}.tar.gz
 -O /tmp/apisix-dashboard.tar.gz \
+    && mkdir /usr/local/apisix-dashboard \
+    && tar -xvf /tmp/apisix-dashboard.tar.gz -C /usr/local/apisix-dashboard 
--strip 1
+
+FROM golang:1.14 as api-builder
+
+ARG ENABLE_PROXY=false
+
+WORKDIR /usr/local/apisix-dashboard
+
+COPY --from=pre-build /usr/local/apisix-dashboard .
+
+WORKDIR /usr/local/apisix-dashboard/api
+
+RUN mkdir -p ../output/conf \
+    && cp ./conf/*.json ../output/conf
+
+RUN wget https://github.com/api7/dag-to-lua/archive/v1.1.tar.gz -O 
/tmp/v1.1.tar.gz \
+    && mkdir /tmp/dag-to-lua \
+    && tar -xvf /tmp/v1.1.tar.gz -C /tmp/dag-to-lua --strip 1 \
+    && mkdir -p ../output/dag-to-lua \
+    && mv /tmp/dag-to-lua/lib/* ../output/dag-to-lua/
+
+RUN if [ "$ENABLE_PROXY" = "true" ] ; then go env -w 
GOPROXY=https://goproxy.io,direct ; fi
+
+RUN go env -w GO111MODULE=on \
+    && CGO_ENABLED=0 go build -o ../output/manager-api .
+
+FROM node:14-alpine as fe-builder
+
+ARG ENABLE_PROXY=false
+
+WORKDIR /usr/local/apisix-dashboard
+
+COPY --from=pre-build /usr/local/apisix-dashboard .
+
+WORKDIR /usr/local/apisix-dashboard/frontend
+
+RUN if [ "$ENABLE_PROXY" = "true" ] ; then yarn config set registry 
https://registry.npm.taobao.org/ ; fi
+
+RUN yarn install
+
+RUN yarn build
+
+FROM alpine:latest as prod
+
+ARG ENABLE_PROXY=false
+
+RUN if [ "$ENABLE_PROXY" = "true" ] ; then sed -i 
's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories ; fi
+
+RUN apk add lua5.1
+
+WORKDIR /usr/local/apisix-dashboard
+
+COPY --from=api-builder /usr/local/apisix-dashboard/output/ ./
+
+# NOTE: Just to compatible with /api/conf/conf.go WebDir

Review comment:
       
https://github.com/apache/apisix-dashboard/blob/feat-docker/api/conf/conf.go#L32
   
   Hmmm I'm not sure if we could use relative path here cc @nic-chen 

##########
File path: .dockerignore
##########
@@ -0,0 +1,2 @@
+**/node_modules
+**/output

Review comment:
       Adding this folder here is because when building and using the current 
folder's sources codes, this folder will be copied to the image unexpectedly, 
we should remove this because we are using codes from release, this issue will 
neverr occur. Good catch!

##########
File path: .dockerignore
##########
@@ -0,0 +1,2 @@
+**/node_modules
+**/output

Review comment:
       Just removed this.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to