Updated Dockerfile
This commit is contained in:
parent
020ebd1f17
commit
7ec409a458
32
Dockerfile
32
Dockerfile
@ -1,19 +1,29 @@
|
|||||||
# Development
|
# Install development environment
|
||||||
FROM golang:1.12.2-alpine as builder
|
FROM golang:1.12.2-alpine as builder
|
||||||
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
|
ENV GO111MODULE=on
|
||||||
RUN go install github.com/aerogo/pack && \
|
RUN apk add --no-cache git nodejs npm make gcc libc-dev && \
|
||||||
|
npm i -g typescript && \
|
||||||
|
go install github.com/aerogo/pack && \
|
||||||
go install github.com/aerogo/run && \
|
go install github.com/aerogo/run && \
|
||||||
go install golang.org/x/tools/cmd/goimports
|
go install golang.org/x/tools/cmd/goimports && \
|
||||||
RUN mkdir /notify.moe
|
git clone --depth=1 https://github.com/animenotifier/database ~/.aero/db/arn && \
|
||||||
ADD go.mod go.sum /notify.moe/
|
mkdir /notify.moe
|
||||||
|
|
||||||
|
# Download dependencies when go.mod or go.sum changes
|
||||||
|
COPY go.mod go.sum /notify.moe/
|
||||||
WORKDIR /notify.moe
|
WORKDIR /notify.moe
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
ADD . /notify.moe
|
|
||||||
RUN tsc && \
|
# Run Typescript compiler when scripts change
|
||||||
pack && \
|
COPY ./scripts /notify.moe/scripts
|
||||||
|
COPY ./tsconfig.json /notify.moe/
|
||||||
|
WORKDIR /notify.moe
|
||||||
|
RUN tsc
|
||||||
|
|
||||||
|
# Build
|
||||||
|
COPY . /notify.moe/
|
||||||
|
WORKDIR /notify.moe
|
||||||
|
RUN pack && \
|
||||||
GOOS=linux go build
|
GOOS=linux go build
|
||||||
|
|
||||||
# Production
|
# Production
|
||||||
|
Loading…
Reference in New Issue
Block a user