Peter
235387c37e
Some checks failed
act_runtime / build_images (node:20-bullseye-slim, ubuntu-latest) (push) Failing after 11s
act_runtime / build_images (node:20-bookworm-slim, ubuntu-latest-amd64) (push) Failing after 12m34s
Image builds / build_images (renovate) (push) Failing after 1m48s
Image builds / build-ente-images (photos) (push) Failing after 3m13s
Image builds / build-ente-images (cast) (push) Failing after 17m9s
act_runtime / build_images (node:20-bookworm-slim, ubuntu-latest) (push) Failing after 17m35s
act_runtime / build_images (node:20-bullseye-slim, ubuntu-latest-amd64) (push) Successful in 5m13s
59 lines
No EOL
1.5 KiB
Docker
59 lines
No EOL
1.5 KiB
Docker
# syntax=docker/dockerfile:1
|
|
FROM node:23-bookworm-slim as ente-builder
|
|
|
|
ARG ENTE_BRANCH=main
|
|
ARG ENTE_APP=photos
|
|
|
|
ENV NEXT_PUBLIC_ENTE_ENDPOINT=DOCKER_RUNTIME_REPLACE_ENDPOINT \
|
|
NEXT_PUBLIC_ENTE_ALBUMS_ENDPOINT=DOCKER_RUNTIME_REPLACE_ALBUMS_ENDPOINT
|
|
|
|
RUN apt update && apt install -y ca-certificates git git-lfs && rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
RUN git clone --recursive --depth=1 --shallow-submodules --branch="${ENTE_BRANCH}" https://github.com/ente-io/ente.git .
|
|
|
|
WORKDIR /app/web
|
|
|
|
RUN yarn install && \
|
|
yarn build:${ENTE_APP}
|
|
|
|
|
|
FROM nginx:1.27-alpine-slim
|
|
|
|
ARG ENTE_APP=photos
|
|
|
|
COPY --from=ente-builder /app/web/apps/${ENTE_APP}/out /usr/share/nginx/html
|
|
COPY <<EOF /etc/nginx/conf.d/default.conf
|
|
server {
|
|
listen 3000 default_server;
|
|
root /usr/share/nginx/html;
|
|
location / {
|
|
try_files \$uri \$uri.html \$uri/ =404;
|
|
}
|
|
error_page 404 /404.html;
|
|
location = /404.html {
|
|
internal;
|
|
}
|
|
}
|
|
EOF
|
|
ARG ENDPOINT="http://localhost:8080"
|
|
ENV ENDPOINT "$ENDPOINT"
|
|
ARG ALBUMS_ENDPOINT="http://localhost:8082"
|
|
ENV ALBUMS_ENDPOINT "$ALBUMS_ENDPOINT"
|
|
COPY <<EOF /docker-entrypoint.d/replace_ente_endpoints.sh
|
|
echo "Replacing endpoints"
|
|
echo " Endpoint: \$ENDPOINT"
|
|
echo " Albums Endpoint: \$ALBUMS_ENDPOINT"
|
|
|
|
replace_enpoints() {
|
|
sed -i -e 's,DOCKER_RUNTIME_REPLACE_ENDPOINT,'"\$ENDPOINT"',g' \$1
|
|
sed -i -e 's,DOCKER_RUNTIME_REPLACE_ALBUMS_ENDPOINT,'"\$ALBUMS_ENDPOINT"',g' \$1
|
|
}
|
|
for jsfile in `find '/usr/share/nginx/html' -type f -name '*.js'`
|
|
do
|
|
replace_enpoints "\$jsfile"
|
|
done
|
|
EOF
|
|
|
|
RUN chmod +x /docker-entrypoint.d/replace_ente_endpoints.sh |