From fe6e7a47b60ec0b778de37fc07d8698310811399 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Tue, 9 Apr 2019 17:49:05 +0900 Subject: [PATCH] Updated docker build --- Dockerfile | 21 ++++++++----------- docker-compose.yml | 7 ++----- .../editform.pixy => mixins/EditForm.pixy | 0 3 files changed, 11 insertions(+), 17 deletions(-) rename utils/editform/editform.pixy => mixins/EditForm.pixy (100%) diff --git a/Dockerfile b/Dockerfile index b9868908..645f6844 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,30 +1,27 @@ # Install development environment FROM golang:1.12.2-alpine as builder ENV GO111MODULE=on -RUN apk add --no-cache git nodejs npm make gcc libc-dev && \ +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 && \ - mkdir /notify.moe + git clone --depth=1 https://github.com/animenotifier/database ~/.aero/db/arn +WORKDIR /notify.moe # Download dependencies when go.mod or go.sum changes -COPY go.mod go.sum /notify.moe/ -WORKDIR /notify.moe +COPY go.mod go.sum ./ RUN go mod download # Run Typescript compiler when scripts change -COPY ./scripts /notify.moe/scripts -COPY ./tsconfig.json /notify.moe/ -WORKDIR /notify.moe +COPY ./tsconfig.json ./ +COPY ./scripts ./scripts RUN tsc # Build -COPY . /notify.moe/ -WORKDIR /notify.moe +COPY . ./ RUN pack && \ - GOOS=linux go build + go build # Production FROM alpine:latest as production @@ -33,4 +30,4 @@ COPY --from=builder /root/.aero /root/.aero COPY --from=builder /notify.moe /notify.moe ENV ARN_ROOT=/notify.moe WORKDIR /notify.moe -CMD ["./notify.moe"] \ No newline at end of file +ENTRYPOINT ["./notify.moe"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index abd8133e..e4a119bd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,6 @@ version: '3' services: - app: - container_name: "notify.moe" + notify.moe: build: . ports: - - "443:4001" - environment: - ARN_ROOT: "/notify.moe" \ No newline at end of file + - "443:4001" \ No newline at end of file diff --git a/utils/editform/editform.pixy b/mixins/EditForm.pixy similarity index 100% rename from utils/editform/editform.pixy rename to mixins/EditForm.pixy