mirror of
https://github.com/stashapp/stash.git
synced 2025-12-11 02:42:43 +01:00
* Update to Go 1.22 Updates to Go 1.22 because 1.19 is un-supported and has some CVEs. Also updates a small number of low-risk deps * Explicitly install Go in CI * Bump compiler version * Add build tags to it target --------- Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
39 lines
1.1 KiB
Docker
39 lines
1.1 KiB
Docker
# This dockerfile should be built with `make docker-build` from the stash root.
|
|
|
|
# Build Frontend
|
|
FROM node:alpine as frontend
|
|
RUN apk add --no-cache make git
|
|
## cache node_modules separately
|
|
COPY ./ui/v2.5/package.json ./ui/v2.5/yarn.lock /stash/ui/v2.5/
|
|
WORKDIR /stash
|
|
COPY Makefile /stash/
|
|
COPY ./graphql /stash/graphql/
|
|
COPY ./ui /stash/ui/
|
|
RUN make pre-ui
|
|
RUN make generate-ui
|
|
ARG GITHASH
|
|
ARG STASH_VERSION
|
|
RUN BUILD_DATE=$(date +"%Y-%m-%d %H:%M:%S") make ui
|
|
|
|
# Build Backend
|
|
FROM golang:1.22-alpine as backend
|
|
RUN apk add --no-cache make alpine-sdk
|
|
WORKDIR /stash
|
|
COPY ./go* ./*.go Makefile gqlgen.yml .gqlgenc.yml /stash/
|
|
COPY ./scripts /stash/scripts/
|
|
COPY ./pkg /stash/pkg/
|
|
COPY ./cmd /stash/cmd
|
|
COPY ./internal /stash/internal
|
|
COPY --from=frontend /stash /stash/
|
|
RUN make generate-backend
|
|
ARG GITHASH
|
|
ARG STASH_VERSION
|
|
RUN make flags-release flags-pie stash
|
|
|
|
# Final Runnable Image
|
|
FROM alpine:latest
|
|
RUN apk add --no-cache ca-certificates vips-tools ffmpeg
|
|
COPY --from=backend /stash/stash /usr/bin/
|
|
ENV STASH_CONFIG_FILE=/root/.stash/config.yml
|
|
EXPOSE 9999
|
|
ENTRYPOINT ["stash"]
|