Skip to content

Commit

Permalink
Non root User in Dockerfile + New certs
Browse files Browse the repository at this point in the history
  • Loading branch information
53845714nF committed Aug 22, 2024
1 parent 8220ca7 commit 64f101a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 37 deletions.
4 changes: 2 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ And last but not least, since it is written in golang, you can export the projec

### 📂 Volume
- `/etc/ssl/certs/` - You can map a volume with the certificates to `/etc/ssl/certs/` in the container.
This helps by problems with the SMTP Authentication. In default are only lets-encrypt certificates supported.
This helps by problems with the SMTP Authentication. Certificates from the Alpine package `ca-certificates` are supported by default.

## 📃 Docs
Please take a look at the GitHub Wiki tab there are sequence diagrams for the process (sign up, login) and a database model.
Please take a look at the GitHub [Wiki](https://github.com/53845714nF/hasura-jwt/wiki) tab there are sequence diagrams for the process (sign up, login) and a database model.

## 🤖 Similar Projects
There is are similar project like this:
Expand Down
15 changes: 11 additions & 4 deletions src/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
FROM golang:1.23.0-alpine3.20 AS build
FROM golang:1.23.0-alpine3.20 AS builder
ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64

RUN apk --no-cache add ca-certificates

WORKDIR /app
COPY . .

RUN go mod download

ENV CGO_ENABLED=0 GOOS=linux
RUN go build -o hasura-jwt ./cmd/api-server

FROM scratch

COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
USER 1001:1001

WORKDIR /app
COPY --from=build /app/hasura-jwt hasura-jwt
COPY letsencrypt.pem /etc/ssl/certs/
COPY --from=builder /app/hasura-jwt hasura-jwt

EXPOSE 3000
ENTRYPOINT ["./hasura-jwt"]
31 changes: 0 additions & 31 deletions src/letsencrypt.pem

This file was deleted.

0 comments on commit 64f101a

Please sign in to comment.