mirror of
https://github.com/ngoduykhanh/wireguard-ui
synced 2024-05-28 11:32:55 +02: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
16
Dockerfile
16
Dockerfile
|
@ -13,8 +13,11 @@ RUN apk add --update --no-cache ${BUILD_DEPENDENCIES}
|
|||
|
||||
WORKDIR /build
|
||||
|
||||
# Add sources
|
||||
COPY . /build
|
||||
# Add dependencies
|
||||
COPY go.mod /build
|
||||
COPY go.sum /build
|
||||
COPY package.json /build
|
||||
COPY yarn.lock /build
|
||||
|
||||
# Prepare assets
|
||||
RUN yarn install --pure-lockfile --production && \
|
||||
|
@ -39,13 +42,16 @@ RUN mkdir -p assets/plugins && \
|
|||
/build/node_modules/jquery-tags-input/ \
|
||||
assets/plugins/
|
||||
|
||||
# Move custom assets
|
||||
RUN cp -r /build/custom/ assets/
|
||||
|
||||
# Get go modules and build tool
|
||||
RUN go mod download && \
|
||||
go get github.com/GeertJohan/go.rice/rice
|
||||
|
||||
# Add sources
|
||||
COPY . /build
|
||||
|
||||
# Move custom assets
|
||||
RUN cp -r /build/custom/ assets/
|
||||
|
||||
# Build
|
||||
RUN rice embed-go && \
|
||||
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -a -o wg-ui .
|
||||
|
|
Loading…
Reference in a new issue