mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-23 00:57:44 +01:00
refactor
This commit is contained in:
parent
e3c0e4b999
commit
42c398fac8
@ -36,7 +36,9 @@ services:
|
||||
syslog-address: "tcp://127.0.0.1:1514"
|
||||
syslog-tag: "mysql"
|
||||
ui:
|
||||
build: ../
|
||||
build:
|
||||
context: ../
|
||||
dockerfile: Dockerfile.ui
|
||||
env_file:
|
||||
- ./config/ui/env
|
||||
volumes:
|
||||
|
@ -9,30 +9,28 @@ RUN apt-get update \
|
||||
COPY . /go/src/github.com/vmware/harbor
|
||||
#golang.org is blocked in China
|
||||
COPY ./vendor/golang.org /go/src/golang.org
|
||||
WORKDIR /go/src/github.com/vmware/harbor
|
||||
WORKDIR /go/src/github.com/vmware/harbor/ui
|
||||
|
||||
ENV GO15VENDOREXPERIMENT 1
|
||||
RUN go get -d github.com/docker/distribution \
|
||||
&& go get -d github.com/docker/libtrust \
|
||||
&& go get -d github.com/go-sql-driver/mysql \
|
||||
&& go install -v -a
|
||||
&& go build -v -a -o /go/bin/harbor_ui
|
||||
|
||||
ENV MYSQL_USR root \
|
||||
MYSQL_PWD root \
|
||||
MYSQL_PORT_3306_TCP_ADDR localhost \
|
||||
MYSQL_PORT_3306_TCP_PORT 3306 \
|
||||
REGISTRY_URL localhost:5000
|
||||
|
||||
COPY views /go/bin/views
|
||||
COPY static /go/bin/static
|
||||
COPY favicon.ico /go/bin/favicon.ico
|
||||
|
||||
RUN chmod u+x /go/bin/harbor \
|
||||
RUN chmod u+x /go/bin/harbor_ui \
|
||||
&& sed -i 's/TLS_CACERT/#TLS_CAERT/g' /etc/ldap/ldap.conf \
|
||||
&& sed -i '$a\TLS_REQCERT allow' /etc/ldap/ldap.conf
|
||||
|
||||
WORKDIR /go/bin/
|
||||
ENTRYPOINT ["/go/bin/harbor"]
|
||||
ENTRYPOINT ["/go/bin/harbor_ui"]
|
||||
|
||||
EXPOSE 80
|
||||
|
@ -24,7 +24,6 @@ import (
|
||||
_ "github.com/vmware/harbor/auth/ldap"
|
||||
"github.com/vmware/harbor/dao"
|
||||
"github.com/vmware/harbor/models"
|
||||
_ "github.com/vmware/harbor/routers"
|
||||
|
||||
"os"
|
||||
|
||||
@ -71,5 +70,6 @@ func main() {
|
||||
if err := updateInitPassword(adminUserID, os.Getenv("HARBOR_ADMIN_PASSWORD")); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
initRouters()
|
||||
beego.Run()
|
||||
}
|
@ -13,7 +13,7 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package routers
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/vmware/harbor/api"
|
||||
@ -23,11 +23,11 @@ import (
|
||||
"github.com/astaxie/beego"
|
||||
)
|
||||
|
||||
func init() {
|
||||
func initRouters() {
|
||||
|
||||
beego.SetStaticPath("registry/static/i18n", "static/i18n")
|
||||
beego.SetStaticPath("registry/static/resources", "static/resources")
|
||||
beego.SetStaticPath("registry/static/vendors", "static/vendors")
|
||||
beego.SetStaticPath("registry/static/i18n", "/static/i18n")
|
||||
beego.SetStaticPath("registry/static/resources", "/static/resources")
|
||||
beego.SetStaticPath("registry/static/vendors", "/static/vendors")
|
||||
|
||||
beego.Router("/login", &controllers.CommonController{}, "post:Login")
|
||||
beego.Router("/logout", &controllers.CommonController{}, "get:Logout")
|
Loading…
Reference in New Issue
Block a user