Fixed issues with public files
This commit is contained in:
parent
a5e5f660e6
commit
ec708a7723
|
@ -1,4 +1,4 @@
|
||||||
FROM golang:1.17.7-alpine3.15 AS builder
|
FROM golang:1.18.1-alpine3.15 AS builder
|
||||||
|
|
||||||
# Install missing pkgs
|
# Install missing pkgs
|
||||||
RUN apk add --no-cache git
|
RUN apk add --no-cache git
|
||||||
|
@ -34,5 +34,8 @@ FROM scratch
|
||||||
|
|
||||||
COPY --from=builder /dist/main /
|
COPY --from=builder /dist/main /
|
||||||
|
|
||||||
|
# Copy public files
|
||||||
|
COPY ./public /public
|
||||||
|
|
||||||
# Command to run
|
# Command to run
|
||||||
ENTRYPOINT ["/main"]
|
ENTRYPOINT ["/main"]
|
|
@ -33,5 +33,10 @@ services:
|
||||||
build: .
|
build: .
|
||||||
depends_on:
|
depends_on:
|
||||||
- auth-api
|
- auth-api
|
||||||
|
environment:
|
||||||
|
- ADMIN_API_KEY=hihi
|
||||||
|
- API_URL=http://auth-api:4000
|
||||||
|
- JWT_SHARED_SECRET=hihi
|
||||||
|
- PORT=4001
|
||||||
ports:
|
ports:
|
||||||
- 8080:80
|
- 4001:4001
|
|
@ -47,7 +47,7 @@ func main() {
|
||||||
app.Use(handlers.LogReq)
|
app.Use(handlers.LogReq)
|
||||||
|
|
||||||
// Static files
|
// Static files
|
||||||
app.Static("/", "./src/public")
|
app.Static("/", "./public")
|
||||||
|
|
||||||
// Unpack user token, refresh token when needed etc.
|
// Unpack user token, refresh token when needed etc.
|
||||||
app.Use(handlers.HandleCookieTokens)
|
app.Use(handlers.HandleCookieTokens)
|
||||||
|
@ -70,5 +70,5 @@ func main() {
|
||||||
err = app.Listen(webBindHost)
|
err = app.Listen(webBindHost)
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Info("Webb server closed, shutting down")
|
log.Info("Web server closed, shutting down")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user