0
0
mirror of https://github.com/vx3r/wg-gen-web.git synced 2025-09-10 12:14:28 +00:00

DockerFile best practices

This commit is contained in:
vx3r
2020-02-06 15:07:15 +09:00
parent b7c88b747b
commit 14660f487d
4 changed files with 7 additions and 117 deletions

View File

@ -1,19 +1,21 @@
FROM golang:alpine AS build-back
WORKDIR /app
ADD . .
COPY . .
RUN go build -o wg-gen-web-linux
FROM node:10-alpine AS build-front
WORKDIR /app
ADD ui .
COPY ui/package*.json ./
RUN npm install
COPY ui/ ./
RUN ls -l
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
ADD .env .
COPY .env .
RUN chmod +x ./wg-gen-web-linux
RUN apk add --no-cache ca-certificates
EXPOSE 8080