mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-06-07 00:46:58 +03:00
Dockerfile: quick re-order of operations to allow for faster re-builds on code change
This commit is contained in:
parent
90bb2851bf
commit
d36941266e
1 changed files with 11 additions and 5 deletions
16
Dockerfile
16
Dockerfile
|
@ -13,8 +13,11 @@ RUN apk add --update --no-cache ${BUILD_DEPENDENCIES}
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
# Add sources
|
# Add dependencies
|
||||||
COPY . /build
|
COPY go.mod /build
|
||||||
|
COPY go.sum /build
|
||||||
|
COPY package.json /build
|
||||||
|
COPY yarn.lock /build
|
||||||
|
|
||||||
# Prepare assets
|
# Prepare assets
|
||||||
RUN yarn install --pure-lockfile --production && \
|
RUN yarn install --pure-lockfile --production && \
|
||||||
|
@ -39,13 +42,16 @@ RUN mkdir -p assets/plugins && \
|
||||||
/build/node_modules/jquery-tags-input/ \
|
/build/node_modules/jquery-tags-input/ \
|
||||||
assets/plugins/
|
assets/plugins/
|
||||||
|
|
||||||
# Move custom assets
|
|
||||||
RUN cp -r /build/custom/ assets/
|
|
||||||
|
|
||||||
# Get go modules and build tool
|
# Get go modules and build tool
|
||||||
RUN go mod download && \
|
RUN go mod download && \
|
||||||
go get github.com/GeertJohan/go.rice/rice
|
go get github.com/GeertJohan/go.rice/rice
|
||||||
|
|
||||||
|
# Add sources
|
||||||
|
COPY . /build
|
||||||
|
|
||||||
|
# Move custom assets
|
||||||
|
RUN cp -r /build/custom/ assets/
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
RUN rice embed-go && \
|
RUN rice embed-go && \
|
||||||
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -a -o wg-ui .
|
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -a -o wg-ui .
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue