Skip to content

Commit

Permalink
feat: improvised docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
proffapt committed Jul 4, 2024
1 parent 7c7bfde commit b63a996
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ RUN go mod download

COPY . .

RUN CGO_ENABLED=1 GOOS=linux go build -o /app --tags "fts5" -a -ldflags '-linkmode external -extldflags "-static"' .
RUN CGO_ENABLED=1 GOOS=linux go build -o ./build -a -ldflags '-linkmode external -extldflags "-static"'

FROM busybox:1.36-musl
FROM alpine:latest AS app

RUN mkdir -p /etc/ssl/certs
RUN apk --no-cache add ca-certificates tzdata bash

COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
ENV TZ="Asia/Kolkata"

COPY metaploy/naarad-api.metaploy.conf /
WORKDIR /app

COPY metaploy/postinstall.sh /
COPY metaploy/ ./

RUN chmod +x /postinstall.sh
RUN chmod +x ./postinstall.sh

COPY --from=builder /app /app
COPY --from=builder /src/build .

CMD ["/postinstall.sh", "/app"]
CMD ["./postinstall.sh", "./build"]

0 comments on commit b63a996

Please sign in to comment.