aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Magorsch <arzano@gentoo.org>2020-06-19 15:51:41 +0200
committerMax Magorsch <arzano@gentoo.org>2020-06-19 15:51:41 +0200
commit21181c518cf41828917d36005b726f9452fde657 (patch)
tree38fab1b3c86a41383e48be6b2686d92efd86db62 /Dockerfile
downloadarchives-21181c518cf41828917d36005b726f9452fde657.tar.gz
archives-21181c518cf41828917d36005b726f9452fde657.tar.bz2
archives-21181c518cf41828917d36005b726f9452fde657.zip
Initial version
Signed-off-by: Max Magorsch <arzano@gentoo.org>
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile18
1 files changed, 18 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..40b206d
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,18 @@
+FROM golang:1.14.0 AS builder
+WORKDIR /go/src/archives
+COPY . /go/src/archives
+RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o bin .
+
+FROM node:13 AS assetsbuilder
+WORKDIR /go/src/archives
+COPY . /go/src/archives
+RUN npm install && cd node_modules/@gentoo/tyrian && npm install && npm run dist && cd /go/src/archives
+RUN npx webpack
+
+FROM scratch
+WORKDIR /go/src/archives
+COPY --from=assetsbuilder /go/src/archives/assets /go/src/archives/assets
+COPY --from=builder /go/src/archives/bin /go/src/archives/bin
+COPY --from=builder /go/src/archives/pkg /go/src/archives/pkg
+COPY --from=builder /go/src/archives/web /go/src/archives/web
+ENTRYPOINT ["/go/src/archives/bin/archives", "serve"]