2020-02-25 08:45:44 +00:00
|
|
|
ARG COMMIT="N/A"
|
|
|
|
|
2021-04-11 15:11:14 +00:00
|
|
|
FROM golang:alpine AS build-back
|
2020-02-05 04:01:17 +00:00
|
|
|
WORKDIR /app
|
2020-02-25 08:45:44 +00:00
|
|
|
ARG COMMIT
|
2020-02-06 06:07:15 +00:00
|
|
|
COPY . .
|
2021-04-06 12:23:23 +00:00
|
|
|
RUN go build -o wg-gen-web-linux -ldflags="-X 'github.com/vx3r/wg-gen-web/version.Version=${COMMIT}'" github.com/vx3r/wg-gen-web/cmd/wg-gen-web
|
2020-01-30 06:45:49 +00:00
|
|
|
|
2023-01-31 15:24:52 +00:00
|
|
|
FROM node:18.13.0-alpine AS build-front
|
2020-01-30 06:45:49 +00:00
|
|
|
WORKDIR /app
|
2020-02-06 06:07:15 +00:00
|
|
|
COPY ui/package*.json ./
|
2020-02-05 04:01:17 +00:00
|
|
|
RUN npm install
|
2020-02-06 06:07:15 +00:00
|
|
|
COPY ui/ ./
|
2020-02-05 04:01:17 +00:00
|
|
|
RUN npm run build
|
2020-01-30 06:45:49 +00:00
|
|
|
|
2020-02-05 04:01:17 +00: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 06:07:15 +00:00
|
|
|
COPY .env .
|
2020-02-05 04:01:17 +00:00
|
|
|
RUN chmod +x ./wg-gen-web-linux
|
|
|
|
RUN apk add --no-cache ca-certificates
|
2020-01-30 06:45:49 +00:00
|
|
|
EXPOSE 8080
|
|
|
|
|
2020-02-05 04:01:17 +00:00
|
|
|
CMD ["/app/wg-gen-web-linux"]
|