You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by "chenyong0923 (via GitHub)" <gi...@apache.org> on 2024/11/03 13:46:23 UTC
[I] How to Deploy front-end [incubator-answer]
chenyong0923 opened a new issue, #1162:
URL: https://github.com/apache/incubator-answer/issues/1162
Building a new image from the official Dockerfile creates a back-end service, right? Does the front-end service need to be deployed separately? When accessing the container's port through a browser, it keeps loading.
<img width="979" alt="image" src="https://github.com/user-attachments/assets/77c8f14b-ce16-4b98-8c57-47068e2b72c6">
<img width="1316" alt="image" src="https://github.com/user-attachments/assets/4ed1fea3-ba42-40cb-9a58-8ebd774958c7">
--
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.
To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] How to Deploy front-end [incubator-answer]
Posted by "chenyong0923 (via GitHub)" <gi...@apache.org>.
chenyong0923 commented on issue #1162:
URL: https://github.com/apache/incubator-answer/issues/1162#issuecomment-2456092353
> > Even when I build an image using the official main branch code, it also keeps loading.
>
> @chenyong0923 That's kind of weird. But you can try using the official image first. `docker pull apache/answer:latest`. If there is no problem, then there must be something wrong with the docker build process. Because the official image is built from the `dockerfile` in the code repository. The whole process is built using GitHub action with no human intervention.
It's normal to pull the official image directly from the Docker Hub, and cloning the official source code and building the image also results in a loading status. I will try it on another computer.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] How to Deploy front-end [incubator-answer]
Posted by "LinkinStars (via GitHub)" <gi...@apache.org>.
LinkinStars commented on issue #1162:
URL: https://github.com/apache/incubator-answer/issues/1162#issuecomment-2456089079
> Even when I build an image using the official main branch code, it also keeps loading.
@chenyong0923 That's kind of weird. But you can try using the official image first. `docker pull apache/answer:latest`. If there is no problem, then there must be something wrong with the docker build process. Because the official image is built from the `dockerfile` in the code repository. The whole process is built using GitHub action with no human intervention.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] How to Deploy front-end [incubator-answer]
Posted by "sosyz (via GitHub)" <gi...@apache.org>.
sosyz commented on issue #1162:
URL: https://github.com/apache/incubator-answer/issues/1162#issuecomment-2454275670
@chenyong0923 Maybe you can use [storage-aliyunoss](https://github.com/apache/incubator-answer-plugins/tree/main/storage-aliyunoss) if you want to save files on OSS ?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] How to Deploy front-end [incubator-answer]
Posted by "chenyong0923 (via GitHub)" <gi...@apache.org>.
chenyong0923 commented on issue #1162:
URL: https://github.com/apache/incubator-answer/issues/1162#issuecomment-2456007447
> @chenyong0923 OK. Then it's very likely that there's a problem with the docker image build process.
Sometimes building an image may result in errors due to installation dependency issues, but even if an image is successfully built, there may still be issues.
<img width="1066" alt="image" src="https://github.com/user-attachments/assets/5cb29619-2c68-493c-928f-acf0835589c1">
<img width="1010" alt="image" src="https://github.com/user-attachments/assets/6afc637e-1a51-4107-b879-806f73be8295">
<img width="1169" alt="image" src="https://github.com/user-attachments/assets/0ab51e30-9fce-40fa-af15-669d51a52cfb">
--
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.
To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] How to Deploy front-end [incubator-answer]
Posted by "chenyong0923 (via GitHub)" <gi...@apache.org>.
chenyong0923 commented on issue #1162:
URL: https://github.com/apache/incubator-answer/issues/1162#issuecomment-2454195046
> @chenyong0923 First of all, for the whole project, the frontend doesn't need to be deployed separately. Just compile the frontend and then the backend, and finally package it into a docker image to start. Then just use the nginx proxy you mentioned to access the port of the container.
Now the mirrored boot has started, and the browser is trying to access the boot port, but it is not able to enter the install page normally. Why is that?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] How to Deploy front-end [incubator-answer]
Posted by "chenyong0923 (via GitHub)" <gi...@apache.org>.
chenyong0923 commented on issue #1162:
URL: https://github.com/apache/incubator-answer/issues/1162#issuecomment-2457225030
> > Even when I build an image using the official main branch code, it also keeps loading.
>
> @chenyong0923 That's kind of weird. But you can try using the official image first. `docker pull apache/answer:latest`. If there is no problem, then there must be something wrong with the docker build process. Because the official image is built from the `dockerfile` in the code repository. The whole process is built using GitHub action with no human intervention.
I found the problem, start the plug-in, the front-end route is lost, get the plug-in state, return undefined, need to add a backstory logic,return undefined, assign an empty array
<img width="1158" alt="image" src="https://github.com/user-attachments/assets/3ae6da1d-9a44-48b9-9aba-401c108d607d">
<img width="1009" alt="image" src="https://github.com/user-attachments/assets/d20cc2fe-2ebb-404c-afd3-8be70089f395">
<img width="525" alt="image" src="https://github.com/user-attachments/assets/51d394b3-275e-4da5-a4dc-792b090adb82">
<img width="707" alt="image" src="https://github.com/user-attachments/assets/16c823b9-898b-409f-a43f-b9c01b7a9b9d">
--
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.
To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] How to Deploy front-end [incubator-answer]
Posted by "chenyong0923 (via GitHub)" <gi...@apache.org>.
chenyong0923 commented on issue #1162:
URL: https://github.com/apache/incubator-answer/issues/1162#issuecomment-2456081095
> @chenyong0923 Well, it looks like a network issue. 🤔
Yes, just keep trying, and you'll be able to build it successfully. However, when I build a successful image, the browser keeps loading the page, and this has been bothering me for a long time. I don't know what the cause is. Even when I build an image using the official main branch code, it also keeps loading.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] How to Deploy front-end [incubator-answer]
Posted by "chenyong0923 (via GitHub)" <gi...@apache.org>.
chenyong0923 closed issue #1162: How to Deploy front-end
URL: https://github.com/apache/incubator-answer/issues/1162
--
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.
To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] How to Deploy front-end [incubator-answer]
Posted by "LinkinStars (via GitHub)" <gi...@apache.org>.
LinkinStars commented on issue #1162:
URL: https://github.com/apache/incubator-answer/issues/1162#issuecomment-2454511692
@chenyong0923 OK. Then it's very likely that there's a problem with the docker image build process.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] How to Deploy front-end [incubator-answer]
Posted by "shuashuai (via GitHub)" <gi...@apache.org>.
shuashuai commented on issue #1162:
URL: https://github.com/apache/incubator-answer/issues/1162#issuecomment-2458631503
>I found the problem, start the plug-in, the front-end route is lost, get the plug-in state, return undefined, need to add a backstory logic,return undefined, assign an empty array
@chenyong0923
I tested it, and it is indeed like this. It should be related to the adjustment of the routing logic of the last load of the socket. The number of interfaces allowed to be accessed when ignoring /install is limited, so there is a problem here during initialization. I will fix it, thanks for the feedback.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] How to Deploy front-end [incubator-answer]
Posted by "LinkinStars (via GitHub)" <gi...@apache.org>.
LinkinStars commented on issue #1162:
URL: https://github.com/apache/incubator-answer/issues/1162#issuecomment-2454184985
@chenyong0923 First of all, for the whole project, the frontend doesn't need to be deployed separately. Just compile the frontend and then the backend, and finally package it into a docker image to start. Then just use the nginx proxy you mentioned to access the port of the container.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] How to Deploy front-end [incubator-answer]
Posted by "chenyong0923 (via GitHub)" <gi...@apache.org>.
chenyong0923 commented on issue #1162:
URL: https://github.com/apache/incubator-answer/issues/1162#issuecomment-2454375103
> @chenyong0923 If you haven't modified the dockerfile, then maybe the build should have a problem. First, you can try to build the frontend locally by `make ui` command. If there is no problem, then keep the output log when executing the `docker build` command to see if there are any error messages during the frontend build process.
I am currently doing it like this: first, I build the front-end make ui, then the back-end make build, both of which are working fine. Finally, I build the image.
<img width="520" alt="image" src="https://github.com/user-attachments/assets/22f617c6-04b3-4b94-a2f7-726a8ac544d9">
--
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.
To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] How to Deploy front-end [incubator-answer]
Posted by "LinkinStars (via GitHub)" <gi...@apache.org>.
LinkinStars commented on issue #1162:
URL: https://github.com/apache/incubator-answer/issues/1162#issuecomment-2454346168
@chenyong0923 If you haven't modified the dockerfile, then maybe the build should have a problem. First, you can try to build the frontend locally by `make ui` command. If there is no problem, then keep the output log when executing the `docker build` command to see if there are any error messages during the frontend build process.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] How to Deploy front-end [incubator-answer]
Posted by "LinkinStars (via GitHub)" <gi...@apache.org>.
LinkinStars commented on issue #1162:
URL: https://github.com/apache/incubator-answer/issues/1162#issuecomment-2456076360
@chenyong0923 Well, it looks like a network issue. 🤔
--
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.
To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] How to Deploy front-end [incubator-answer]
Posted by "chenyong0923 (via GitHub)" <gi...@apache.org>.
chenyong0923 commented on issue #1162:
URL: https://github.com/apache/incubator-answer/issues/1162#issuecomment-2456117239
> > Even when I build an image using the official main branch code, it also keeps loading.
>
> @chenyong0923 That's kind of weird. But you can try using the official image first. `docker pull apache/answer:latest`. If there is no problem, then there must be something wrong with the docker build process. Because the official image is built from the `dockerfile` in the code repository. The whole process is built using GitHub action with no human intervention.
When will the official mirror image support the last video? This is a necessary requirement, so I have made a secondary development.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] How to Deploy front-end [incubator-answer]
Posted by "chenyong0923 (via GitHub)" <gi...@apache.org>.
chenyong0923 closed issue #1162: How to Deploy front-end
URL: https://github.com/apache/incubator-answer/issues/1162
--
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.
To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] How to Deploy front-end [incubator-answer]
Posted by "chenyong0923 (via GitHub)" <gi...@apache.org>.
chenyong0923 commented on issue #1162:
URL: https://github.com/apache/incubator-answer/issues/1162#issuecomment-2454264099
> @chenyong0923 If you are rebuilding the image, could you give the command and dockerfile that you built it with? If there are any other modifications please include them as well.
I just supported uploading videos, changed the local storage of images and videos to OSS, and kept the Dockerfile the same as the official one.
`
# 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.22-alpine AS golang-builder
LABEL maintainer="linkinstar@apache.org"
ARG GOPROXY
# ENV GOPROXY ${GOPROXY:-direct}
# ENV GOPROXY=https://proxy.golang.com.cn,direct
ENV GOPROXY=https://goproxy.cn,direct
ENV GOPATH /go
ENV GOROOT /usr/local/go
ENV PACKAGE github.com/apache/incubator-answer
ENV BUILD_DIR ${GOPATH}/src/${PACKAGE}
ENV ANSWER_MODULE ${BUILD_DIR}
ARG TAGS="sqlite sqlite_unlock_notify"
ENV TAGS "bindata timetzdata $TAGS"
ARG CGO_EXTRA_CFLAGS
COPY . ${BUILD_DIR}
WORKDIR ${BUILD_DIR}
RUN apk --no-cache add build-base git bash nodejs npm && npm install -g pnpm@8.9.2 \
&& make clean build
RUN chmod 755 answer
RUN ["/bin/bash","-c","script/build_plugin.sh"]
RUN cp answer /usr/bin/answer
RUN mkdir -p /data/uploads && chmod 777 /data/uploads \
&& mkdir -p /data/i18n && cp -r i18n/*.yaml /data/i18n
FROM alpine
LABEL maintainer="linkinstar@apache.org"
ARG TIMEZONE
ENV TIMEZONE=${TIMEZONE:-"Asia/Shanghai"}
RUN apk update \
&& apk --no-cache add \
bash \
ca-certificates \
curl \
dumb-init \
gettext \
openssh \
sqlite \
gnupg \
tzdata \
&& ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime \
&& echo "${TIMEZONE}" > /etc/timezone
COPY --from=golang-builder /usr/bin/answer /usr/bin/answer
COPY --from=golang-builder /data /data
COPY /script/entrypoint.sh /entrypoint.sh
RUN chmod 755 /entrypoint.sh
VOLUME /data
EXPOSE 80
ENTRYPOINT ["/entrypoint.sh"]
`
--
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.
To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] How to Deploy front-end [incubator-answer]
Posted by "chenyong0923 (via GitHub)" <gi...@apache.org>.
chenyong0923 commented on issue #1162:
URL: https://github.com/apache/incubator-answer/issues/1162#issuecomment-2454304084
> @chenyong0923 Maybe you can use [storage-aliyunoss](https://github.com/apache/incubator-answer-plugins/tree/main/storage-aliyunoss) if you want to save files on OSS ?
Thanks,I mainly want to upload videos, does this plugin support video uploads? Or is it only for storing images on Oss? I have already implemented the local function, but the problem is that the rebuilt image service keeps loading.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] How to Deploy front-end [incubator-answer]
Posted by "chenyong0923 (via GitHub)" <gi...@apache.org>.
chenyong0923 commented on issue #1162:
URL: https://github.com/apache/incubator-answer/issues/1162#issuecomment-2454078793
When deploying to the production environment, you would first package the image, then deploy the backend, and then deploy the frontend via nginx, right?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] How to Deploy front-end [incubator-answer]
Posted by "LinkinStars (via GitHub)" <gi...@apache.org>.
LinkinStars commented on issue #1162:
URL: https://github.com/apache/incubator-answer/issues/1162#issuecomment-2454214480
@chenyong0923 If you are rebuilding the image, could you give the command and dockerfile that you built it with? If there are any other modifications please include them as well.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org