mirror of
https://github.com/Dvorinka/SpotifyRecAlg.git
synced 2026-06-03 20:13:03 +00:00
dockerfile
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
|||||||
|
FROM golang:1.24-bookworm AS backend-build
|
||||||
|
|
||||||
|
WORKDIR /src/backend
|
||||||
|
COPY apps/backend/go.mod apps/backend/go.sum* ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY apps/backend/ .
|
||||||
|
RUN go install github.com/pressly/goose/v3/cmd/goose@v3.24.3
|
||||||
|
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/recommendation-api ./cmd/api
|
||||||
|
|
||||||
|
FROM gcr.io/distroless/static-debian12:nonroot
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY --from=backend-build /out/recommendation-api /app/recommendation-api
|
||||||
|
COPY --from=backend-build /go/bin/goose /app/goose
|
||||||
|
COPY apps/backend/migrations /app/migrations
|
||||||
|
COPY apps/backend/docs /app/docs
|
||||||
|
COPY apps/web/index.html /app/web/index.html
|
||||||
|
COPY apps/web/app.js /app/web/app.js
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
ENTRYPOINT ["/app/recommendation-api"]
|
||||||
@@ -62,6 +62,10 @@ func NewRouter(cfg RouterConfig) http.Handler {
|
|||||||
v1.POST("/providers/musicbrainz/enrich", handler.enrichMusicBrainz)
|
v1.POST("/providers/musicbrainz/enrich", handler.enrichMusicBrainz)
|
||||||
v1.GET("/providers/status", handler.providerStatus)
|
v1.GET("/providers/status", handler.providerStatus)
|
||||||
|
|
||||||
|
router.Static("/static", "./web/static")
|
||||||
|
router.StaticFile("/", "./web/index.html")
|
||||||
|
router.StaticFile("/app.js", "./web/app.js")
|
||||||
|
|
||||||
return router
|
return router
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-14
@@ -1,24 +1,12 @@
|
|||||||
version: "3.8"
|
version: "3.8"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
backend:
|
app:
|
||||||
build:
|
build:
|
||||||
context: ./apps/backend
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
environment:
|
environment:
|
||||||
- ENV=${ENV:-development}
|
- ENV=${ENV:-development}
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
frontend:
|
|
||||||
build:
|
|
||||||
context: ./apps/web
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
ports:
|
|
||||||
- "3000:3000"
|
|
||||||
environment:
|
|
||||||
- API_URL=http://backend:8080
|
|
||||||
depends_on:
|
|
||||||
- backend
|
|
||||||
restart: unless-stopped
|
|
||||||
|
|||||||
Reference in New Issue
Block a user