images/ente/web/Dockerfile
Peter Kurfer 24f5950f8e
All checks were successful
act_runtime / build_images (node:20-bullseye-slim, ubuntu-latest) (push) Successful in 5m29s
Image builds / build-argo-cd-image (push) Successful in 13s
act_runtime / build_images (node:20-bookworm-slim, ubuntu-latest) (push) Successful in 5m45s
Image builds / build-ente-images (push) Successful in 38s
act_runtime / build_images (node:20-bookworm-slim, ubuntu-latest-amd64) (push) Successful in 6m32s
Image builds / build_images (renovate) (push) Successful in 56s
act_runtime / build_images (node:20-bullseye-slim, ubuntu-latest-amd64) (push) Successful in 16s
feat(act): install Github CLI
2024-05-15 17:41:13 +02:00

53 lines
No EOL
1.4 KiB
Docker

# syntax=docker/dockerfile:1
FROM node:21-bookworm-slim as ente-builder
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 https://github.com/ente-io/ente.git .
WORKDIR /app/web
RUN yarn install && \
yarn build
FROM nginx:1.25-alpine-slim
COPY --from=ente-builder /app/web/apps/photos/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