Fix Railway Docker volume build
This commit is contained in:
+3
-2
@@ -5,13 +5,14 @@ WORKDIR /src
|
|||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /out/urapt-server ./cmd/urapt-server \
|
RUN mkdir -p /out/data/store \
|
||||||
|
&& CGO_ENABLED=0 go build -ldflags="-s -w" -o /out/urapt-server ./cmd/urapt-server \
|
||||||
&& CGO_ENABLED=0 go build -ldflags="-s -w" -o /out/urapt ./cmd/urapt
|
&& CGO_ENABLED=0 go build -ldflags="-s -w" -o /out/urapt ./cmd/urapt
|
||||||
|
|
||||||
FROM gcr.io/distroless/static-debian12:nonroot
|
FROM gcr.io/distroless/static-debian12:nonroot
|
||||||
COPY --from=build /out/urapt-server /usr/local/bin/urapt-server
|
COPY --from=build /out/urapt-server /usr/local/bin/urapt-server
|
||||||
|
COPY --from=build --chown=nonroot:nonroot /out/data /data
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
VOLUME ["/data"]
|
|
||||||
ENV URAPT_STORE_DIR=/data/store
|
ENV URAPT_STORE_DIR=/data/store
|
||||||
ENV URAPT_BASE_URL=http://localhost:8080
|
ENV URAPT_BASE_URL=http://localhost:8080
|
||||||
USER nonroot:nonroot
|
USER nonroot:nonroot
|
||||||
|
|||||||
Reference in New Issue
Block a user