2021-11-27 13:26:14 +00:00
|
|
|
FROM node:14-alpine3.14 AS node-builder
|
|
|
|
|
|
|
|
RUN apk --no-cache --virtual build-dependencies add \
|
|
|
|
g++ \
|
|
|
|
make
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
COPY frontend/ .
|
|
|
|
ARG API_URL
|
|
|
|
ENV REACT_APP_API_URL=$API_URL
|
|
|
|
RUN yarn install
|
|
|
|
RUN yarn build
|
|
|
|
|
|
|
|
FROM golang:1.17.3-alpine3.14 as go-builder
|
|
|
|
ENV GOPATH ""
|
|
|
|
|
|
|
|
RUN go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
ADD backend/go.mod backend/go.sum ./
|
|
|
|
RUN go mod download
|
|
|
|
ADD backend/ .
|
|
|
|
RUN go build -o ./clipper ./cmd/clipper/
|
|
|
|
|
|
|
|
FROM alpine:3.14
|
|
|
|
RUN apk add ffmpeg
|
|
|
|
|
|
|
|
COPY backend/sql/migrations /app/migrations
|
|
|
|
COPY --from=go-builder /app/clipper /bin/clipper
|
|
|
|
COPY --from=go-builder /root/go/bin/migrate /bin/migrate
|
|
|
|
COPY --from=node-builder /app/build /app/assets
|
|
|
|
|
2022-01-18 16:56:37 +00:00
|
|
|
ENV CLIPPER_ASSETS_HTTP_ROOT "/app/assets"
|
2021-11-27 13:26:14 +00:00
|
|
|
|
|
|
|
ENTRYPOINT ["/bin/clipper"]
|