0
0
mirror of https://github.com/vx3r/wg-gen-web.git synced 2025-04-02 16:46:52 +00:00
wg-gen-web/Dockerfile
Dmytro Bondar af7c29f21a
Refactor workflow:
- Replace `prep` step by `docker/metadata-action`
- Use vars and secrets to support customizations for:
      - registry name
      - registry user
      - registry password
      - image name
      - image platforms

Signed-off-by: Dmytro Bondar <git@bonddim.com>
2023-09-20 21:28:21 +02:00

26 lines
599 B
Docker

ARG COMMIT="N/A"
FROM golang:alpine AS build-back
WORKDIR /app
ARG COMMIT
COPY . .
RUN go build -o wg-gen-web-linux -ldflags="-X 'github.com/vx3r/wg-gen-web/version.Version=${COMMIT::7}'" github.com/vx3r/wg-gen-web/cmd/wg-gen-web
FROM node:18.13.0-alpine AS build-front
WORKDIR /app
COPY ui/package*.json ./
RUN npm install
COPY ui/ ./
RUN npm run build
FROM alpine
WORKDIR /app
COPY --from=build-back /app/wg-gen-web-linux .
COPY --from=build-front /app/dist ./ui/dist
COPY .env .
RUN chmod +x ./wg-gen-web-linux
RUN apk add --no-cache ca-certificates
EXPOSE 8080
CMD ["/app/wg-gen-web-linux"]