forked from thousandeyes/shoelaces
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
51 lines (36 loc) · 1.82 KB
/
Dockerfile
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
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM golang:1.19-alpine AS build
WORKDIR /shoelaces
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-s -w -extldflags "-static"' -o /tmp/shoelaces . && \
printf "---\nnetworkMaps:\n" > /tmp/mappings.yaml
##
## FIXME: Use a scratch image for the final image, when the following are done:
## - Ability to copy the default config files/folders into the default or custom path
## - Ability to copy the default web/static files/folders into the default or custom path
## - Anything else we'd need? Don't think so?
## - TODO: We could just "pack" the default files into the binary itself,
## which it could then "unpack" into the default or custom paths?!
##
# Final container has basically nothing in it but the executable
# FROM scratch
FROM golang:1.19-alpine
COPY --from=build /tmp/shoelaces /shoelaces
# RUN mkdir -p /shoelaces_default/{data,web} /data /web
COPY --from=build /tmp/mappings.yaml /shoelaces_default/data/mappings.yaml
COPY --from=build /shoelaces/configs/data-dir /shoelaces_default/data
COPY --from=build /shoelaces/web /shoelaces_default/web
COPY docker_entrypoint.sh /entrypoint
RUN chmod +x /entrypoint
ENV BIND_ADDR 0.0.0.0:80
ENV BASE_URL localhost
ENV PUID 1000
ENV PGID 100
EXPOSE 80
VOLUME [ "/data", "/web" ]
# ENTRYPOINT ["/shoelaces", "-data-dir", "/data", "-static-dir", "/web"]
# CMD []
ENTRYPOINT ["/entrypoint"]
# CMD ["/shoelaces", "-bind-addr", "0.0.0.0:80", "-data-dir", "/data/", "-static-dir", "/web/", "-template-extension", ".slc", "-mappings-file", "mappings.yaml", "-debug", "true"]
CMD ["/shoelaces", "-data-dir", "/data/", "-static-dir", "/web/", "-template-extension", ".slc", "-mappings-file", "mappings.yaml", "-debug", "false", "-domain", "$BASE_URL"]
# domain
# ENTRYPOINT ["/entrypoint", "/shoelaces", "-data-dir", "/data", "-static-dir", "/web"]