add dockerfile
This commit is contained in:
16
dockerfile
Normal file
16
dockerfile
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
FROM golang:1.23.1-alpine3.20 as build
|
||||||
|
|
||||||
|
COPY . /src
|
||||||
|
|
||||||
|
RUN cd /src \
|
||||||
|
&& go build -o downloadhub \
|
||||||
|
&& mkdir -p ./fs/var/opt/downloadhub \
|
||||||
|
&& mkdir -p ./fs/opt/downloadhub \
|
||||||
|
&& cp downloadhub ./fs/opt/downloadhub/downloadhub
|
||||||
|
|
||||||
|
FROM scratch as prod
|
||||||
|
|
||||||
|
COPY --from=build --chmod=755 /src/fs /
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
ENTRYPOINT [ "/opt/downloadhub/downloadhub", "-c", "/var/opt/downloadhub/content.json" ]
|
||||||
Reference in New Issue
Block a user