mirror of
https://github.com/Dvorinka/SpotifyRecAlg.git
synced 2026-07-28 23:03:47 +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/[email protected]
|
||||
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.GET("/providers/status", handler.providerStatus)
|
||||
|
||||
router.Static("/static", "./web/static")
|
||||
router.StaticFile("/", "./web/index.html")
|
||||
router.StaticFile("/app.js", "./web/app.js")
|
||||
|
||||
return router
|
||||
}
|
||||
|
||||
|
||||
+2
-14
@@ -1,24 +1,12 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
backend:
|
||||
app:
|
||||
build:
|
||||
context: ./apps/backend
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "8080:8080"
|
||||
environment:
|
||||
- ENV=${ENV:-development}
|
||||
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