Updated installation instructions

This commit is contained in:
2019-04-14 16:28:30 +09:00
parent ba8d7e72d3
commit c210ab36ee
6 changed files with 42 additions and 112 deletions

View File

@ -1,33 +1,9 @@
# Install development environment
FROM golang:1.12.2-alpine as builder
ENV GO111MODULE=on
RUN apk add --no-cache git nodejs npm make gcc musl-dev && \
npm i -g typescript && \
go install github.com/aerogo/pack && \
go install github.com/aerogo/run && \
go install golang.org/x/tools/cmd/goimports && \
git clone --depth=1 https://github.com/animenotifier/database ~/.aero/db/arn
WORKDIR /notify.moe
FROM blitzprog/aero
RUN git clone --progress --verbose --depth=1 https://github.com/animenotifier/database ~/.aero/db/arn
# Download dependencies when go.mod or go.sum changes
COPY go.mod go.sum ./
RUN go mod download
# Run Typescript compiler when scripts change
COPY ./tsconfig.json ./
COPY ./scripts ./scripts
RUN tsc
# Build
COPY . ./
RUN pack && \
go build
# Production
FROM alpine:latest as production
RUN apk add --no-cache ca-certificates
COPY --from=builder /root/.aero /root/.aero
COPY --from=builder /notify.moe /notify.moe
ENV ARN_ROOT=/notify.moe
WORKDIR /notify.moe
ENTRYPOINT ["./notify.moe"]
# Expect ~/notify.moe to be mounted as a volume
RUN cd ~/notify.moe && \
tsc && \
pack && \
go build