1
0
mirror of https://github.com/flant/ovpn-admin.git synced 2024-11-30 08:16:46 +02:00
ovpn-admin/Dockerfile

18 lines
849 B
Docker
Raw Normal View History

2020-10-15 18:12:31 +02:00
FROM node:14.2-alpine3.11 AS frontend-builder
COPY frontend/ /app
RUN cd /app && npm install && npm run build
2021-11-29 10:34:34 +02:00
FROM golang:1.15.8-buster AS backend-builder
2021-11-23 09:57:11 +02:00
RUN go get -u github.com/gobuffalo/packr/packr2
COPY --from=frontend-builder /app/static /app/frontend/static
COPY . /app
2021-11-29 10:34:34 +02:00
RUN cd /app && packr2 && env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -a -tags netgo -ldflags '-linkmode external -extldflags -static -s -w' -o ovpn-admin && packr2 clean
2021-11-29 10:34:34 +02:00
FROM alpine:3.14
2020-10-15 18:12:31 +02:00
WORKDIR /app
2021-03-17 11:05:37 +02:00
COPY --from=backend-builder /app/ovpn-admin /app
RUN apk add --update bash easy-rsa && \
2020-10-15 18:12:31 +02:00
ln -s /usr/share/easy-rsa/easyrsa /usr/local/bin && \
wget https://github.com/pashcovich/openvpn-user/releases/download/v1.0.3/openvpn-user-linux-amd64.tar.gz -O - | tar xz -C /usr/local/bin && \
2020-10-15 18:12:31 +02:00
rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/*