From 185f135549fea0e68fd90af1fc67da282fe107ad Mon Sep 17 00:00:00 2001 From: vx3r Date: Mon, 3 Feb 2020 19:14:15 +0900 Subject: [PATCH] all docker images to alpine --- .gitlab-ci.yml | 4 ++-- Dockerfile | 2 +- Dockerfile.dev | 15 ++++++++------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index df3289a..fdab377 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,9 +4,9 @@ stages: build-back: stage: build - image: golang:latest + image: golang:alpine script: - - GOOS=linux GOARCH=amd64 go build -o ${CI_PROJECT_NAME}-linux-amd64 + - go build -o ${CI_PROJECT_NAME}-linux-amd64 artifacts: paths: - ${CI_PROJECT_NAME}-linux-amd64 diff --git a/Dockerfile b/Dockerfile index 2ee2151..6441d27 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:stable-slim +FROM alpine WORKDIR /app diff --git a/Dockerfile.dev b/Dockerfile.dev index 05bf312..8b53d35 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -1,20 +1,21 @@ -FROM golang as build-back -WORKDIR /wg-gen-web +FROM golang:alpine AS build-back +WORKDIR /app ADD . . RUN go build -o wg-gen-web-linux-amd64 FROM node:10-alpine as build-front -WORKDIR /ui +WORKDIR /app ADD ui . RUN npm install RUN npm run build -FROM debian:stable-slim +FROM alpine WORKDIR /app -COPY --from=build-back /wg-gen-web/wg-gen-web-linux-amd64 . -COPY --from=build-front /ui/dist ./ui/dist +COPY --from=build-back /app/wg-gen-web-linux-amd64 . +COPY --from=build-front /app/dist ./ui/dist ADD .env . RUN chmod +x ./wg-gen-web-linux-amd64 +RUN apk add --no-cache ca-certificates EXPOSE 8080 -CMD ["/app/wg-gen-web-linux-amd64"] +CMD ["/app/wg-gen-web-linux-amd64"] \ No newline at end of file