26 lines
742 B
Docker
Raw Normal View History

2019-04-08 11:18:18 +00:00
# Development
2019-04-08 10:16:59 +00:00
FROM golang:1.12.2-alpine as builder
2019-04-08 11:18:18 +00:00
RUN apk add --no-cache git nodejs npm make gcc libc-dev
RUN npm i -g typescript
RUN git clone --depth=1 https://github.com/animenotifier/database ~/.aero/db/arn
ENV GO111MODULE=on
RUN go install github.com/aerogo/pack && \
go install github.com/aerogo/run && \
go install golang.org/x/tools/cmd/goimports
2019-04-08 05:43:13 +00:00
RUN mkdir /notify.moe
2019-04-08 11:18:18 +00:00
ADD go.mod go.sum /notify.moe/
2019-04-08 05:43:13 +00:00
WORKDIR /notify.moe
RUN go mod download
2019-04-08 11:18:18 +00:00
ADD . /notify.moe
RUN tsc && \
pack && \
GOOS=linux go build
2019-04-08 10:16:59 +00:00
2019-04-08 11:18:18 +00:00
# Production
2019-04-08 10:16:59 +00:00
FROM alpine:latest as production
2019-04-08 11:18:18 +00:00
RUN apk add ca-certificates
2019-04-08 10:16:59 +00:00
COPY --from=builder /root/.aero /root/.aero
COPY --from=builder /notify.moe /notify.moe
2019-04-08 11:18:18 +00:00
ENV ARN_ROOT=/notify.moe
2019-04-08 10:16:59 +00:00
WORKDIR /notify.moe
CMD ["./notify.moe"]