2020-02-05 05:01:17 +01:00
|
|
|
FROM golang:alpine AS build-back
|
|
|
|
WORKDIR /app
|
2020-02-25 08:19:00 +01:00
|
|
|
RUN apk update && apk upgrade && apk add --no-cache git
|
2020-02-06 07:07:15 +01:00
|
|
|
COPY . .
|
2020-02-25 07:56:04 +01:00
|
|
|
RUN GIT_COMMIT=$(git rev-parse --short HEAD) && go build -ldflags "-X main.VersionGitCommit=$GIT_COMMIT" go build -o wg-gen-web-linux
|
2020-01-30 07:45:49 +01:00
|
|
|
|
2020-02-06 05:30:36 +01:00
|
|
|
FROM node:10-alpine AS build-front
|
2020-01-30 07:45:49 +01:00
|
|
|
WORKDIR /app
|
2020-02-25 08:19:00 +01:00
|
|
|
RUN apk update && apk upgrade && apk add --no-cache git
|
2020-02-06 07:07:15 +01:00
|
|
|
COPY ui/package*.json ./
|
2020-02-05 05:01:17 +01:00
|
|
|
RUN npm install
|
2020-02-06 07:07:15 +01:00
|
|
|
COPY ui/ ./
|
2020-02-25 08:07:44 +01:00
|
|
|
COPY .git .
|
2020-02-05 05:01:17 +01:00
|
|
|
RUN npm run build
|
2020-01-30 07:45:49 +01:00
|
|
|
|
2020-02-05 05:01:17 +01:00
|
|
|
FROM alpine
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=build-back /app/wg-gen-web-linux .
|
|
|
|
COPY --from=build-front /app/dist ./ui/dist
|
2020-02-06 07:07:15 +01:00
|
|
|
COPY .env .
|
2020-02-05 05:01:17 +01:00
|
|
|
RUN chmod +x ./wg-gen-web-linux
|
|
|
|
RUN apk add --no-cache ca-certificates
|
2020-01-30 07:45:49 +01:00
|
|
|
EXPOSE 8080
|
|
|
|
|
2020-02-05 05:01:17 +01:00
|
|
|
CMD ["/app/wg-gen-web-linux"]
|