Skip to content

Commit 3e004e4

Browse files
authored
add migrate script to non-standalone image (#932)
1 parent d2e22f3 commit 3e004e4

File tree

2 files changed

+48
-2
lines changed

2 files changed

+48
-2
lines changed

Dockerfile.service

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,45 @@
1-
# you probably don't want to use this Dockerfile directly,
1+
# you probably don't want to build this Dockerfile directly,
22
# use `make <svc>` instead
33

4+
#
5+
# pull deps
6+
#
7+
FROM debian:12.8 AS deps
8+
9+
10+
# renovate: datasource=github-releases depName=golang-migrate/migrate
11+
ARG MIGRATE_VERSION=4.18.1
12+
13+
14+
RUN apt update && \
15+
apt install -y wget
16+
17+
# get migrate
18+
RUN wget -q https://github.com/golang-migrate/migrate/releases/download/v$MIGRATE_VERSION/migrate.linux-amd64.tar.gz -O - | tar -xzvf - migrate
19+
20+
421
# builder builds a go service
522
# the build args SERVICE and VERSION must be set!
623

724
FROM golang:1.23-bookworm AS builder
825

26+
#
27+
# build spice helper (for migrations)
28+
#
29+
30+
WORKDIR /build/spice
31+
32+
COPY go.* ./
33+
COPY libs libs
34+
COPY spicedb/migrations spicedb/migrations
35+
RUN go mod download
36+
COPY cmd/spice cmd/spice
37+
RUN CGO_ENABLED=0 GOOS=linux go build -a -o spice cmd/spice/spice.go
38+
39+
#
40+
# build service
41+
#
42+
943
ARG SERVICE
1044
ARG VERSION
1145

@@ -27,10 +61,22 @@ RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-X main.Version=${VERSION}" -a -
2761

2862
FROM alpine:3.21.0 AS production
2963

64+
RUN apk update && apk add postgresql-client --no-cache
65+
3066
WORKDIR /app
3167

68+
# copy deps
69+
COPY --from=deps /migrate /usr/bin/migrate
70+
COPY --from=builder /build/spice/spice /usr/bin/spice
71+
COPY docker-run-migrations.sh ./run-migrations.sh
72+
73+
# copy app
3274
COPY --from=builder /build/app/app .
3375
COPY --from=builder /build/app/migrations ./migrations
76+
COPY spicedb ./spicedb
77+
78+
# fix permissions
79+
RUN chmod +x run-migrations.sh
3480
RUN chmod +x app
3581

3682
ENV PORT=80

libs/common/auth/auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
// to avoid ambiguity please read: https://wiki.helpwave.de/doc/keycloak-jedzCcERwF
2020

2121
var (
22-
DefaultOAuthIssuerURL = "https://accounts.helpwave.de/realms/helpwave"
22+
DefaultOAuthIssuerURL = "https://id.helpwave.de/realms/main"
2323
DefaultOAuthClientID = "helpwave-services"
2424
onlyFakeAuthEnabled bool
2525
insecureFakeTokenEnable = false

0 commit comments

Comments
 (0)