2021-10-22 02:14:08 +00:00
|
|
|
# This dockerfile should be built with `make docker-build` from the stash root.
|
2020-02-24 00:40:56 +00:00
|
|
|
|
2021-09-08 05:30:15 +00:00
|
|
|
# Build Frontend
|
|
|
|
FROM node:alpine as frontend
|
2021-10-22 02:14:08 +00:00
|
|
|
RUN apk add --no-cache make
|
2021-09-08 05:30:15 +00:00
|
|
|
## cache node_modules separately
|
|
|
|
COPY ./ui/v2.5/package.json ./ui/v2.5/yarn.lock /stash/ui/v2.5/
|
|
|
|
WORKDIR /stash
|
|
|
|
RUN yarn --cwd ui/v2.5 install --frozen-lockfile.
|
|
|
|
COPY Makefile /stash/
|
|
|
|
COPY ./graphql /stash/graphql/
|
|
|
|
COPY ./ui /stash/ui/
|
|
|
|
RUN make generate-frontend
|
2021-10-22 02:14:08 +00:00
|
|
|
ARG GITHASH
|
|
|
|
ARG STASH_VERSION
|
2021-09-22 03:08:34 +00:00
|
|
|
RUN BUILD_DATE=$(date +"%Y-%m-%d %H:%M:%S") make ui
|
2021-09-08 05:30:15 +00:00
|
|
|
|
|
|
|
# Build Backend
|
|
|
|
FROM golang:1.17-alpine as backend
|
2021-10-22 02:14:08 +00:00
|
|
|
RUN apk add --no-cache make alpine-sdk
|
2020-02-24 00:40:56 +00:00
|
|
|
WORKDIR /stash
|
2021-09-08 05:30:15 +00:00
|
|
|
COPY ./go* ./*.go Makefile gqlgen.yml .gqlgenc.yml /stash/
|
|
|
|
COPY ./scripts /stash/scripts/
|
|
|
|
COPY ./vendor /stash/vendor/
|
|
|
|
COPY ./pkg /stash/pkg/
|
2022-03-23 02:35:42 +00:00
|
|
|
COPY ./cmd /stash/cmd
|
|
|
|
COPY ./internal /stash/internal
|
2021-09-08 05:30:15 +00:00
|
|
|
COPY --from=frontend /stash /stash/
|
|
|
|
RUN make generate-backend
|
2021-10-22 02:14:08 +00:00
|
|
|
ARG GITHASH
|
|
|
|
ARG STASH_VERSION
|
2020-02-24 00:40:56 +00:00
|
|
|
RUN make build
|
|
|
|
|
2021-09-08 05:30:15 +00:00
|
|
|
# Final Runnable Image
|
|
|
|
FROM alpine:latest
|
2021-10-22 02:14:08 +00:00
|
|
|
RUN apk add --no-cache ca-certificates vips-tools ffmpeg
|
|
|
|
COPY --from=backend /stash/stash /usr/bin/
|
2021-04-11 23:31:33 +00:00
|
|
|
ENV STASH_CONFIG_FILE=/root/.stash/config.yml
|
2020-02-24 00:40:56 +00:00
|
|
|
EXPOSE 9999
|
2022-03-23 02:35:42 +00:00
|
|
|
ENTRYPOINT ["stash"]
|