2021-09-19 18:03:32 +02:00
|
|
|
FROM --platform=$BUILDPLATFORM node:lts as builder
|
2018-07-12 05:30:13 +02:00
|
|
|
WORKDIR /opt/app
|
|
|
|
|
2019-11-04 01:48:10 +01:00
|
|
|
COPY package.json package-lock.json ./
|
2018-07-12 05:30:13 +02:00
|
|
|
RUN npm install
|
|
|
|
|
|
|
|
COPY . ./
|
|
|
|
|
|
|
|
ARG BUILD_INFO="docker-latest"
|
|
|
|
ARG CLIENT_BUILD_ARGS=""
|
2018-09-03 23:36:06 +02:00
|
|
|
RUN BASE_URL="__BASEURL__" node build.js --gzip ${CLIENT_BUILD_ARGS}
|
2018-07-12 05:30:13 +02:00
|
|
|
|
|
|
|
|
2021-09-19 18:03:32 +02:00
|
|
|
FROM --platform=$BUILDPLATFORM scratch as approot
|
2018-07-12 05:30:13 +02:00
|
|
|
|
2019-09-29 01:28:04 +02:00
|
|
|
COPY docker-start.sh /
|
2018-07-12 05:30:13 +02:00
|
|
|
|
2019-09-29 01:28:04 +02:00
|
|
|
WORKDIR /etc/nginx
|
|
|
|
COPY nginx.conf.docker ./nginx.conf
|
2018-07-12 05:30:13 +02:00
|
|
|
|
2019-09-29 01:28:04 +02:00
|
|
|
WORKDIR /var/www
|
2018-07-12 05:30:13 +02:00
|
|
|
COPY --from=builder /opt/app/public/ .
|
2019-09-29 01:28:04 +02:00
|
|
|
|
|
|
|
|
2020-08-28 20:43:10 +02:00
|
|
|
FROM nginx:alpine as release
|
2019-09-29 01:28:04 +02:00
|
|
|
|
|
|
|
RUN apk --no-cache add dumb-init
|
|
|
|
COPY --from=approot / /
|
|
|
|
|
|
|
|
CMD ["/docker-start.sh"]
|
|
|
|
VOLUME ["/data"]
|
2019-10-05 00:58:05 +02:00
|
|
|
|
|
|
|
ARG DOCKER_REPO
|
|
|
|
ARG BUILD_DATE
|
|
|
|
ARG SOURCE_COMMIT
|
|
|
|
LABEL \
|
|
|
|
maintainer="" \
|
|
|
|
org.opencontainers.image.title="${DOCKER_REPO}" \
|
|
|
|
org.opencontainers.image.url="https://github.com/rr-/szurubooru" \
|
|
|
|
org.opencontainers.image.documentation="https://github.com/rr-/szurubooru/blob/${SOURCE_COMMIT}/doc/INSTALL.md" \
|
|
|
|
org.opencontainers.image.created="${BUILD_DATE}" \
|
|
|
|
org.opencontainers.image.source="https://github.com/rr-/szurubooru" \
|
|
|
|
org.opencontainers.image.revision="${SOURCE_COMMIT}" \
|
|
|
|
org.opencontainers.image.licenses="GPL-3.0"
|