0
0
mirror of https://github.com/vx3r/wg-gen-web.git synced 2024-12-18 00:13:23 +00:00

all docker images to alpine

This commit is contained in:
vx3r 2020-02-03 19:14:15 +09:00
parent 5cb19c365f
commit 185f135549
3 changed files with 11 additions and 10 deletions

View File

@ -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

View File

@ -1,4 +1,4 @@
FROM debian:stable-slim
FROM alpine

WORKDIR /app


View File

@ -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"]