mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-05-07 12:58:12 +00:00
1382ab41e7
* wip * fix: fix util imports * fix: fix bootstrap import issues * fix: fix cli imports * fix: context controller * fix: use new context in user controller * fix: fix imports and context in proxy controller * fix: fix oauth and oidc controller imports and context * feat: finalize context functionality * refactor: simplify acls checking logic by passing the entire acl struct * chore: rename get basic auth to encode basic auth for clarity * fix: fix controller tests * tests: fix service tests * tests: fix utils tests * tests: move to testify for testing in utils * fix: fix config reference generator * tests: add tests for context parsing * tests: add tests for context middleware * tests: remove error wrapper from context tests * tests: fix log wrapper tests * fix: fix verion setting in cd and dockerfiles * fix: review comments batch 1 * fix: review comments batch 2 * fix: review comments batch 3 * fix: delete totp pending session cookie on totp success * tests: fix user controller tests * fix: don't audit login too early * fix: own comments
67 lines
1.4 KiB
Docker
67 lines
1.4 KiB
Docker
# Site builder
|
|
FROM oven/bun:1.3.13-alpine AS frontend-builder
|
|
|
|
WORKDIR /frontend
|
|
|
|
COPY ./frontend/package.json ./
|
|
COPY ./frontend/bun.lock ./
|
|
|
|
RUN bun install --frozen-lockfile
|
|
|
|
COPY ./frontend/public ./public
|
|
COPY ./frontend/src ./src
|
|
COPY ./frontend/eslint.config.js ./
|
|
COPY ./frontend/index.html ./
|
|
COPY ./frontend/tsconfig.json ./
|
|
COPY ./frontend/tsconfig.app.json ./
|
|
COPY ./frontend/tsconfig.node.json ./
|
|
COPY ./frontend/vite.config.ts ./
|
|
|
|
RUN bun run build
|
|
|
|
# Builder
|
|
FROM golang:1.26-alpine3.23 AS builder
|
|
|
|
ARG VERSION
|
|
ARG COMMIT_HASH
|
|
ARG BUILD_TIMESTAMP
|
|
|
|
WORKDIR /tinyauth
|
|
|
|
COPY go.mod ./
|
|
COPY go.sum ./
|
|
|
|
RUN go mod download
|
|
|
|
COPY ./cmd ./cmd
|
|
COPY ./internal ./internal
|
|
COPY --from=frontend-builder /frontend/dist ./internal/assets/dist
|
|
|
|
RUN CGO_ENABLED=0 go build -ldflags "-s -w \
|
|
-X github.com/tinyauthapp/tinyauth/internal/model.Version=${VERSION} \
|
|
-X github.com/tinyauthapp/tinyauth/internal/model.CommitHash=${COMMIT_HASH} \
|
|
-X github.com/tinyauthapp/tinyauth/internal/model.BuildTimestamp=${BUILD_TIMESTAMP}" ./cmd/tinyauth
|
|
|
|
# Runner
|
|
FROM alpine:3.23 AS runner
|
|
|
|
WORKDIR /tinyauth
|
|
|
|
COPY --from=builder /tinyauth/tinyauth ./
|
|
|
|
RUN mkdir -p /data
|
|
|
|
EXPOSE 3000
|
|
|
|
VOLUME ["/data"]
|
|
|
|
ENV TINYAUTH_DATABASE_PATH=/data/tinyauth.db
|
|
|
|
ENV TINYAUTH_RESOURCES_PATH=/data/resources
|
|
|
|
ENV PATH=$PATH:/tinyauth
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 CMD ["tinyauth", "healthcheck"]
|
|
|
|
ENTRYPOINT ["tinyauth"]
|