fix: update build script

This commit is contained in:
Lakhan Samani
2021-12-29 05:10:21 +05:30
parent 4c53eb97d2
commit 43dce69cce
6 changed files with 28 additions and 23 deletions

View File

@@ -1,5 +1,5 @@
FROM golang:1.17-alpine as builder
WORKDIR /app
FROM golang:1.17-alpine as go-builder
WORKDIR /authorizer
COPY server server
COPY Makefile .
@@ -7,15 +7,22 @@ ARG VERSION="latest"
ENV VERSION="$VERSION"
RUN echo "$VERSION"
RUN apk add build-base nodejs &&\
RUN apk add build-base &&\
make clean && make && \
chmod 777 build/server
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
FROM node:17-alpine3.12 as node-builder
WORKDIR /authorizer
COPY app app
COPY Makefile .
RUN apk add build-base &&\
make build-app
FROM alpine:latest
WORKDIR /root/
RUN mkdir app
COPY --from=node-builder /authorizer/app/build app/build
COPY --from=go-builder /authorizer/build build
COPY templates templates
COPY --from=builder /app/build build
EXPOSE 8080
CMD [ "./build/server" ]