oko-server/Dockerfile
zegkljan 7506421848
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
thumbnail content type
* content type of thumbnail is separated from the full photo content type
* remove git from build dependencies in Dockerfile
2022-02-20 01:09:54 +01:00

20 lines
548 B
Docker

FROM alpine:3.15.0 AS build
VOLUME ["/data"]
COPY . /oko-server/git
RUN apk add --no-cache go && \
cd /oko-server/git && \
go build -ldflags "-X \"main.sha1ver=$(cat .git/$(cat .git/HEAD | sed 's|ref: ||g'))\" -X \"main.buildTime=$(date -Iseconds)\""
FROM alpine:3.15.0
WORKDIR /oko-server
VOLUME [ "/data" ]
RUN echo -e '#!/bin/sh\n/oko-server/oko-server "$@"' > /oko-server/entrypoint.sh && \
chmod +x /oko-server/entrypoint.sh
COPY --from=build /oko-server/git/oko-server/ /oko-server/
ENTRYPOINT ["/oko-server/entrypoint.sh"]