feat: build static file in global process
- Create a webui DockerFile - add task `generate-webui` - use task `generate-webui` in build process
This commit is contained in:
parent
faa7fd0f05
commit
5bfcfeb779
4 changed files with 34 additions and 4 deletions
8
Makefile
8
Makefile
|
@ -24,10 +24,10 @@ default: binary
|
||||||
all: build
|
all: build
|
||||||
$(DOCKER_RUN_TRAEFIK) ./script/make.sh
|
$(DOCKER_RUN_TRAEFIK) ./script/make.sh
|
||||||
|
|
||||||
binary: build
|
binary: build generate-webui
|
||||||
$(DOCKER_RUN_TRAEFIK) ./script/make.sh generate binary
|
$(DOCKER_RUN_TRAEFIK) ./script/make.sh generate binary
|
||||||
|
|
||||||
crossbinary: build
|
crossbinary: build generate-webui
|
||||||
$(DOCKER_RUN_TRAEFIK) ./script/make.sh generate crossbinary
|
$(DOCKER_RUN_TRAEFIK) ./script/make.sh generate crossbinary
|
||||||
|
|
||||||
test: build
|
test: build
|
||||||
|
@ -52,6 +52,7 @@ validate-golint: build
|
||||||
$(DOCKER_RUN_TRAEFIK) ./script/make.sh validate-golint
|
$(DOCKER_RUN_TRAEFIK) ./script/make.sh validate-golint
|
||||||
|
|
||||||
build: dist
|
build: dist
|
||||||
|
docker build -t traefik-webui -f webui/Dockerfile webui
|
||||||
docker build -t "$(TRAEFIK_DEV_IMAGE)" -f build.Dockerfile .
|
docker build -t "$(TRAEFIK_DEV_IMAGE)" -f build.Dockerfile .
|
||||||
|
|
||||||
build-no-cache: dist
|
build-no-cache: dist
|
||||||
|
@ -70,3 +71,6 @@ run-dev:
|
||||||
go generate
|
go generate
|
||||||
go build
|
go build
|
||||||
./traefik
|
./traefik
|
||||||
|
|
||||||
|
generate-webui:
|
||||||
|
docker run --rm -v "$$PWD/static":'/src/static' traefik-webui gulp build
|
||||||
|
|
|
@ -83,6 +83,7 @@ Refer to the [benchmarks section](docs/index.md#benchmarks) in the documentation
|
||||||
You need either [Docker](https://github.com/docker/docker) and `make`, or `go` and `glide` in order to build traefik.
|
You need either [Docker](https://github.com/docker/docker) and `make`, or `go` and `glide` in order to build traefik.
|
||||||
|
|
||||||
#### Setting up your `go` environment
|
#### Setting up your `go` environment
|
||||||
|
|
||||||
- You need `go` v1.5
|
- You need `go` v1.5
|
||||||
- You need to set `export GO15VENDOREXPERIMENT=1` environment variable
|
- You need to set `export GO15VENDOREXPERIMENT=1` environment variable
|
||||||
- You need `go-bindata` to be able to use `go generate` command (needed to build) : `go get github.com/jteeuwen/go-bindata/...`.
|
- You need `go-bindata` to be able to use `go generate` command (needed to build) : `go get github.com/jteeuwen/go-bindata/...`.
|
||||||
|
@ -90,8 +91,7 @@ You need either [Docker](https://github.com/docker/docker) and `make`, or `go` a
|
||||||
|
|
||||||
#### Using `Docker` and `Makefile`
|
#### Using `Docker` and `Makefile`
|
||||||
|
|
||||||
You need to run the `binary` target. This will create binaries for
|
You need to run the `binary` target. This will create binaries for Linux platform in the `dist` folder.
|
||||||
linux platform in the `dist` folder.
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ make binary
|
$ make binary
|
||||||
|
|
18
webui/Dockerfile
Normal file
18
webui/Dockerfile
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
FROM node:5.4
|
||||||
|
|
||||||
|
ENV WEBUI_DIR /src/webui
|
||||||
|
RUN mkdir -p $WEBUI_DIR
|
||||||
|
|
||||||
|
RUN npm install -g gulp bower
|
||||||
|
|
||||||
|
COPY package.json $WEBUI_DIR/
|
||||||
|
COPY .bowerrc $WEBUI_DIR/
|
||||||
|
COPY bower.json $WEBUI_DIR/
|
||||||
|
|
||||||
|
WORKDIR $WEBUI_DIR
|
||||||
|
RUN npm install
|
||||||
|
RUN bower install --allow-root
|
||||||
|
|
||||||
|
COPY . $WEBUI_DIR/
|
||||||
|
|
||||||
|
EXPOSE 3000 3001 8080
|
|
@ -8,6 +8,14 @@ Træfɪk Web UI provide 2 types of informations:
|
||||||
- Providers with their backends and frontends information.
|
- Providers with their backends and frontends information.
|
||||||
- Health of the web server.
|
- Health of the web server.
|
||||||
|
|
||||||
|
## How to build (for backends developer)
|
||||||
|
|
||||||
|
Use the make file :
|
||||||
|
|
||||||
|
```shell
|
||||||
|
make build # Generate Docker image
|
||||||
|
make generate-webui # Generate static contents in `traefik/static/` folder.
|
||||||
|
```
|
||||||
|
|
||||||
## How to build (only for frontends developer)
|
## How to build (only for frontends developer)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue