add dockerfile

This commit is contained in:
2024-11-01 22:44:55 +01:00
parent 8ce5189b62
commit aed88a5f29

16
dockerfile Normal file
View 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" ]