-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (27 loc) · 967 Bytes
/
Copy pathDockerfile
File metadata and controls
38 lines (27 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM ghcr.io/umputun/baseimage/buildgo:latest AS build
ARG GIT_BRANCH
ARG GITHUB_SHA
ARG CI
# Install mailcap package which contains mime.types
RUN apk add --no-cache mailcap
ADD . /build
WORKDIR /build
RUN go version
RUN \
if [ -z "$CI" ] ; then \
echo "runs outside of CI" && version=$(git rev-parse --abbrev-ref HEAD)-$(git log -1 --format=%h)-$(date +%Y%m%dT%H:%M:%S); \
else version=${GIT_BRANCH}-${GITHUB_SHA:0:7}-$(date +%Y%m%dT%H:%M:%S); fi && \
echo "version=$version" && \
go build -o /build/weblist -ldflags "-X main.revision=${version} -s -w"
FROM ghcr.io/umputun/baseimage/scratch:latest
LABEL org.opencontainers.image.source="https://github.com/umputun/weblist"
COPY --from=build /build/weblist /srv/weblist
COPY --from=build /etc/mime.types /etc/mime.types
VOLUME ["/data"]
WORKDIR /data
USER app
# Expose the port the app will run on
EXPOSE 8080
# Run the application
ENTRYPOINT ["/srv/weblist"]
CMD ["--listen=:8080", "--theme=dark"]