mirror of
https://github.com/woodchen-ink/webp_server_go.git
synced 2025-07-18 13:42:02 +08:00
fix(Dockerfile): fix config.json PATH in Dockerfile (#45)
This commit is contained in:
parent
bfb34a8166
commit
e99e918e97
@ -1,10 +1,12 @@
|
|||||||
FROM golang:alpine as builder
|
FROM golang:alpine as builder
|
||||||
|
ARG IMG_PATH=/opt/pics
|
||||||
|
ARG EXHAUST_PATH=/opt/exhaust
|
||||||
RUN apk update ;\
|
RUN apk update ;\
|
||||||
apk add alpine-sdk ;\
|
apk add alpine-sdk ;\
|
||||||
git clone https://github.com/webp-sh/webp_server_go /build ;\
|
git clone https://github.com/webp-sh/webp_server_go /build ;\
|
||||||
cd /build ;\
|
cd /build ;\
|
||||||
sed -i 's/\/path\/to\/exhaust/\/opt\/exhaust/g' config.json ;\
|
sed -i "s|.\/pics|${IMG_PATH}|g" config.json ;\
|
||||||
sed -i 's/\/path\/to\/pics/\/opt\/pics/g' config.json ;\
|
sed -i "s|\"\"|\"${EXHAUST_PATH}\"|g" config.json ;\
|
||||||
sed -i 's/127.0.0.1/0.0.0.0/g' config.json
|
sed -i 's/127.0.0.1/0.0.0.0/g' config.json
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
RUN go build -o webp-server .
|
RUN go build -o webp-server .
|
||||||
@ -13,4 +15,4 @@ COPY --from=builder /build/webp-server /usr/bin/webp-server
|
|||||||
COPY --from=builder /build/config.json /etc/config.json
|
COPY --from=builder /build/config.json /etc/config.json
|
||||||
WORKDIR /opt
|
WORKDIR /opt
|
||||||
VOLUME /opt/exhaust
|
VOLUME /opt/exhaust
|
||||||
CMD ["/usr/bin/webp-server", "--config", "/etc/config.json"]
|
CMD ["/usr/bin/webp-server", "--config", "/etc/config.json"]
|
Loading…
x
Reference in New Issue
Block a user