Update release script to build/distribute backend

This commit is contained in:
2020-05-03 19:19:28 +02:00
parent a9c24051b0
commit 957912c9fc
8 changed files with 179 additions and 24 deletions

View File

@ -1,24 +1,37 @@
FROM alpine:3.11 AS build
FROM golang:1.13 AS build
RUN apk add --no-cache nodejs npm git make
ARG HTTP_PROXY=
ARG HTTPS_PROXY=
ARG http_proxy=
ARG https_proxy=
RUN apt-get update && apt-get install -y build-essential git bash curl
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - \
&& apt-get install -y nodejs
COPY . /src
WORKDIR /src
RUN make install-deps \
&& make build
RUN ( cd client && npm install ) \
&& ( cd server && go mod vendor ) \
&& make ARCH_TARGETS=amd64 release
FROM alpine:3.11
FROM busybox
COPY --from=build /src/client/dist /client
COPY --from=build /src/release/server-linux-amd64 /app
WORKDIR /client
WORKDIR /app
RUN apk add --no-cache caddy
COPY misc/dokku/Caddyfile /client/Caddyfile
COPY misc/dokku/CHECKS /client/CHECKS
EXPOSE 80
CMD ["caddy"]
VOLUME /data
ENV GUESSTIMATE_HTTP_ADDRESS=:80
ENV GUESSTIMATE_HTTP_PUBLIC_DIR=/app/public
ENV GUESSTIMATE_DATA_PATH=/data/guesstimate.db
CMD ["/app/bin/server", "-config", "config.yml"]