Created
December 15, 2021 14:36
-
-
Save siteslave/f5b05b3f5ea6ca77928720ce4439f958 to your computer and use it in GitHub Desktop.
Dockerfile for angular project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Stage 0 | |
FROM node:14-alpine3.12 as ngbuilder | |
LABEL maintainer="Satit Rianpit <[email protected]>" | |
WORKDIR /home/xxx | |
RUN apk add --upgrade --no-cache --virtual deps python3 build-base git | |
COPY . . | |
RUN npm i | |
RUN npm i -g @angular/cli | |
RUN npm run build | |
# Stage 1 | |
FROM golang:alpine as builder | |
RUN apk update && apk add --no-cache git | |
RUN mkdir /build | |
ADD ./server /build/ | |
WORKDIR /build | |
RUN go build -o server . | |
# Stage 2 | |
FROM alpine | |
RUN adduser -S -D -H -h /app siteslave | |
USER siteslave | |
COPY --from=builder /build/ /app/ | |
COPY --from=ngbuilder /home/xxx/dist/web/ /app/web/ | |
WORKDIR /app | |
CMD ["./server"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
server.go