2020-03-24 21:39:32 +00:00
|
|
|
FROM golang:1.14 as builder
|
2020-03-24 20:32:35 +00:00
|
|
|
|
2020-03-25 16:11:31 +00:00
|
|
|
WORKDIR /go/src/git.eeqj.de/sneak/orangesite
|
2020-03-24 20:32:35 +00:00
|
|
|
COPY . .
|
|
|
|
|
|
|
|
#RUN make lint && make build
|
|
|
|
RUN make build
|
|
|
|
|
|
|
|
WORKDIR /go
|
|
|
|
RUN tar cvfz go-src.tgz src && du -sh *
|
|
|
|
|
|
|
|
# this container doesn't do anything except hold the build artifact
|
|
|
|
# and make sure it compiles.
|
|
|
|
|
|
|
|
FROM alpine
|
|
|
|
|
2020-03-25 04:05:23 +00:00
|
|
|
RUN mkdir -p /app/bin
|
|
|
|
|
2020-03-25 16:11:31 +00:00
|
|
|
COPY --from=builder /go/src/git.eeqj.de/sneak/orangesite/server /app/bin/server
|
2020-03-25 04:05:23 +00:00
|
|
|
# FIXME figure out how to embed these stupid templates
|
2020-03-25 16:11:31 +00:00
|
|
|
COPY --from=builder /go/src/git.eeqj.de/sneak/orangesite/view /app/view
|
2020-03-24 20:32:35 +00:00
|
|
|
|
|
|
|
# put the source in there too for safekeeping
|
|
|
|
COPY --from=builder /go/go-src.tgz /usr/local/src/go-src.tgz
|
|
|
|
|
2020-03-25 04:05:23 +00:00
|
|
|
# this is where the db gets stored:
|
|
|
|
VOLUME /data
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
CMD /app/bin/server
|
2020-03-24 20:32:35 +00:00
|
|
|
|
|
|
|
# FIXME add testing
|