You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/11/03 13:49:52 UTC

[GitHub] [apisix-dashboard] ShiningRush commented on a change in pull request #657: feat: deploy with Docker

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



##########
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:
       source codes is in work directory, we can use tag to control source code, it is not need to get codes from release.
   if we have a tag `v2.0-rc3`, it's directory as beflow
   ```
   apisix-dashboard
   +-api
   +-web
   +-Makefile
   +-Dockerfile
   ```
   when we run `docker build .` in this directory, docker will default copy all files to build stage, you can configure what file is need for image by `ADD stage-path container-path`.
   so when we execute `docker build` in specific tag, it will use the specific  codes.

##########
File path: docs/deploy-with-docker.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.
+#
+-->
+
+# Deploy with Docker
+
+1. Build image
+
+```sh
+$ docker build -t apisix-dashboard:2.0-rc3 .

Review comment:
       `apisix-dashboard:2.0-rc3` ->`apisix-dashboard:{tag}` would be better, document should keep stable.

##########
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:
       > this step should be optional. Is it only useful for Chinese developers?
   Yes, we can add some description for this line.

##########
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:
       > this step should be optional. Is it only useful for Chinese developers?
   
   Yes, we can add some description for this line.

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

Review comment:
       Why ignore this directory?`output` is looks like the build result.
   If it is just a test result or other files unnecessary, we can rename it more meaningful.




----------------------------------------------------------------
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:
users@infra.apache.org