Use docker-compose watch mode for auth

This commit is contained in:
Zoe Roux 2025-05-19 13:59:47 +02:00
parent 69577d8806
commit fca0d8d7ea
No known key found for this signature in database
4 changed files with 35 additions and 45 deletions

View File

@ -1,10 +1,9 @@
Dockerfile*
*.md
.dockerignore
.gitignore
.env*
**
!/go.mod
!/go.sum
!/**.go
# generated via sqlc
dbc/
!/sql
!/dbc
# genereated via swag
docs/
!/docs

View File

@ -1,18 +1,10 @@
FROM golang:1.24 AS build
WORKDIR /app
RUN go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
RUN go install github.com/swaggo/swag/cmd/swag@latest
COPY go.mod go.sum ./
RUN go mod download
COPY sqlc.yaml ./
COPY sql ./sql
RUN sqlc generate
COPY . .
RUN swag init --parseDependency --outputTypes json,go
RUN CGO_ENABLED=0 GOOS=linux go build -o /keibi
FROM gcr.io/distroless/base-debian11
@ -23,5 +15,4 @@ USER nonroot:nonroot
COPY --from=build /keibi /app/keibi
COPY sql ./sql
HEALTHCHECK --interval=30s --retries=15 CMD curl --fail http://localhost:4568$KEIBI_PREFIX/health || exit
CMD ["/app/keibi"]

View File

@ -1,11 +1,10 @@
FROM golang:1.24 AS build
WORKDIR /app
RUN go install github.com/bokwoon95/wgo@latest
COPY go.mod go.sum ./
RUN go mod download
COPY . .
EXPOSE 4568
HEALTHCHECK --interval=30s --retries=15 CMD curl --fail http://localhost:4568$KEIBI_PREFIX/health || exit
CMD ["wgo", "run", "-race", "."]
CMD ["go", "run", "-race", "."]

View File

@ -21,26 +21,26 @@ x-transcoder: &transcoder-base
- transcoder_metadata:/metadata
services:
front:
build:
context: ./front
dockerfile: Dockerfile.dev
volumes:
- ./front:/app
- /app/.yarn
- /app/node_modules
- /app/apps/mobile/node_modules
- /app/apps/web/.next/
- /app/apps/mobile/.expo/
ports:
- "3000:3000"
- "8081:8081"
restart: on-failure
environment:
- KYOO_URL=${KYOO_URL:-http://api:5000/api}
labels:
- "traefik.enable=true"
- "traefik.http.routers.front.rule=PathPrefix(`/`)"
# front:
# build:
# context: ./front
# dockerfile: Dockerfile.dev
# volumes:
# - ./front:/app
# - /app/.yarn
# - /app/node_modules
# - /app/apps/mobile/node_modules
# - /app/apps/web/.next/
# - /app/apps/mobile/.expo/
# ports:
# - "3000:3000"
# - "8081:8081"
# restart: on-failure
# environment:
# - KYOO_URL=${KYOO_URL:-http://api:5000/api}
# labels:
# - "traefik.enable=true"
# - "traefik.http.routers.front.rule=PathPrefix(`/`)"
auth:
build:
@ -54,13 +54,14 @@ services:
- "4568:4568"
env_file:
- ./.env
environment:
- KEIBI_PREFIX=/auth
volumes:
- ./auth:/app
labels:
- "traefik.enable=true"
- "traefik.http.routers.auth.rule=PathPrefix(`/auth/`) || PathPrefix(`/.well-known/`)"
develop:
watch:
- action: sync+restart
path: ./auth
target: /app
api:
build: