Replies: 8 comments 31 replies
-
Thanks for the suggestion.
It is not inappropriate to include it in the code, however, we don't yet want to pre-commit to a particular way of using the web app with Docker. This is because
So for now, I'm not fully sure if we want to add this Dockerfile to the web code. Maybe this is the correct approach, but still want to mull a bit more over this before adding something (and then later trying to take it out).
Feel free! That is maybe the best option now, it can help other people too. You can add your guide in a new file under https://github.com/ente-io/ente/tree/main/docs/docs/self-hosting/guides (+add an entry in sidebar.ts), and once published it'll appear in https://help.ente.io/self-hosting/guides/.
rather, thank you 😊 |
Beta Was this translation helpful? Give feedback.
-
This does not seem to work for me, the build exits with an error:
Any hints? |
Beta Was this translation helpful? Give feedback.
-
I liked this Dockerfile and wanted to make it so it automatically updated itself from the git repo. This is what I came up with, hopefully others find it useful: Dockerfile FROM node:20-alpine
RUN apk add --no-cache git
WORKDIR /app
RUN npm install -g serve
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["serve", "-s", "/data/ente/web/apps/photos/out", "-l", "tcp://0.0.0.0:3000"]
EXPOSE 3000 entrypoint.sh #!/bin/sh
# Exit on any error
set -e
# Clone the repository
if [ ! -d "/data/ente/.git" ]; then
git clone https://github.com/ente-io/ente.git /data/ente
cd /data/ente/web
git submodule update --init --recursive
else
cd /data/ente
git pull
cd /data/ente/web
git submodule update --recursive
fi
# Install dependencies
yarn install
# Build the application
if [ -d "/data/ente/web/apps/photos/out" ]; then
echo "Removing previous build directory."
rm -rf /data/ente/web/apps/photos/out
fi
yarn build:photos
# Execute the command provided as arguments to the entrypoint (if any)
exec "$@" compose.yml services:
app:
container_name: ente-photos
environment:
NEXT_PUBLIC_ENTE_ENDPOINT: "https://foo.bar"
NEXT_PUBLIC_ALBUMS_ENDPOINT: "https://foo.bar"
build: .
volumes:
- ./data:/data
ports:
- "3000:3000"
restart: always |
Beta Was this translation helpful? Give feedback.
-
@plumber-craic @aqsede @LI-NA @adamlacombe I have spent the last 1.5 weeks trying to edit the dockerfile here - https://help.ente.io/self-hosting/guides/external-s3 to be able to include photos and accounts (for passkey) support and have been miserably unsuccessful. With the image generated from the current dockerfile when I choose passkey it routes me to account.ento.io instead of account.xxx.in. Please could one of you help me edit the dockerfile to include web/accounts or if there is already a dockerfile with you where passkey works ? Happy to ping you on discord/reddit etc but really trying to get this straightned out. Here is the dockerfile that I edited with help from chatgpt (sorry i'm no developer) but all I reach on port 8082, 8083 is the nginx welcome page |
Beta Was this translation helpful? Give feedback.
-
Hi, node noob here that only read documentation and didn't try at all to run this yet, can I ask a technical detail on your Dockerfile? If I understood right, once built with Is |
Beta Was this translation helpful? Give feedback.
-
@LI-NA I have provided below changes that were made that seems incorrect. Let me know if I have made a mistake? Are you able to help how the dockerfile can be changed to include everything during the build process itself? and not when the containers start. For older systems it take a long wait time (~30 mins) for containers to spin up the first time. Any other thoughts?? # For Photo
FROM node:21-alpine as builder
WORKDIR /app
COPY . .
ARG NEXT_PUBLIC_ENTE_ENDPOINT=http://localhost:8080
ENV NEXT_PUBLIC_ENTE_ENDPOINT=${NEXT_PUBLIC_ENTE_ENDPOINT}
ARG NEXT_PUBLIC_ENTE_ALBUMS_ENDPOINT=http://localhost:8081 #changed to ALBUMBS_ENDPOINT
ENV NEXT_PUBLIC_ENTE_ALBUMS_ENDPOINT=${NEXT_PUBLIC_ENTE_ALBUMS_ENDPOINT} #changed to ALBUMBS_ENDPOINT
RUN yarn install && yarn build
FROM node:21-alpine
WORKDIR /app
COPY --from=builder /app/apps/photos/out .
RUN npm install -g serve
ENV PORT_PHOTOS=3000 #PORT FOR ENTE WEB TO WORK
EXPOSE ${PORT_PHOTOS}
ENV PORT_ALBUMS=3002 #PORT FOR ALBUM SHARING
EXPOSE ${PORT_ALBUMS}
CMD ["sh", "-c", "serve -s /data/ente/web/apps/photos/out -l tcp://0.0.0.0:${PORT_PHOTOS} & serve -s /data/ente/web/apps/photos/out -l tcp://0.0.0.0:${PORT_ALBUMS} & wait"] #EXPOSE BOTH PORTS # For Account
FROM node:21-alpine as builder
WORKDIR /app
COPY . .
ARG NEXT_PUBLIC_ENTE_ENDPOINT=http://localhost:8080
ENV NEXT_PUBLIC_ENTE_ENDPOINT=${NEXT_PUBLIC_ENTE_ENDPOINT}
ARG NEXT_PUBLIC_ENTE_ACCOUNTS_URL=http://localhost:3031
ENV NEXT_PUBLIC_ENTE_ACCOUNTS_URL=${NEXT_PUBLIC_ENTE_ACCOUNTS_URL}
RUN yarn install && yarn build
FROM node:21-alpine
WORKDIR /app
COPY --from=builder /app/apps/accounts/out .
RUN npm install -g serve
ENV PORT=3001
EXPOSE ${PORT}
CMD serve -s . -l tcp://0.0.0.0:${PORT} services:
photo:
build:
context: ./ente/web
dockerfile: ../../photo.Dockerfile
network: host
args:
NEXT_PUBLIC_ENTE_ENDPOINT: https://your_museum_endpoint
NEXT_PUBLIC_ENTE_ALBUMS_ENDPOINT: https://your_account_domain #This was changed to reflect albums endpoint
container_name: ente-photo
restart: on-failure:3
# Your photo expose port:3000
ports:
- 3000:3000 #WEB
- 3002:3002 #ALBUM SHARING
networks:
- net
account:
build:
context: ./ente/web
dockerfile: ../../account.Dockerfile
network: host
args:
NEXT_PUBLIC_ENTE_ENDPOINT: https://your_museum_endpoint
NEXT_PUBLIC_ENTE_ACCOUNTS_URL: https://your_account_domain
container_name: ente-account
restart: on-failure:3
# Your account expose port:3001
ports:
- 3001:3001
networks:
- net
networks:
net: |
Beta Was this translation helpful? Give feedback.
-
@vicky-bs You don't need 2 serve commands in your Photos Dockerfile as both photos and albums are being served from the same directory. You just need to pass -l twice (See my Dockerfile) @LI-NA You can use one Dockerfile for multiple apps without nginx as well. Here is what I have for Photos, Albums and the Auth apps.
|
Beta Was this translation helpful? Give feedback.
-
Ente web can also be run as a super simple systemd-service if you don't want to get into the mess of setting up a separate dockerfile. I'll mostly add this to the docs after talking with the devs, but till then here's the systemd-service which is working fine for me. [Unit]
Description=Run Ente Web as a service
[Service]
Type=simple
Restart=always
WorkingDirectory=/home/mangesh/dev/ente/web
Environment=NEXT_PUBLIC_ENTE_ENDPOINT=http://localhost:8000
ExecStart=/usr/bin/yarn dev
[Install]
WantedBy=multi-user.target Put the above contents into a separate file under |
Beta Was this translation helpful? Give feedback.
-
Hi there.
Recently ente became open source and I'm looking for a way to deploy all ente apps at once using docker-compose.
I've written the following code and am using it to deploy the web version with docker as well.
(This dockerfile is for photo.)
How about adding a dockerfile like this to the web folder and making it easier for many users to use the web in docker-compose?
If you think it's inappropriate to include it in the code, I'll write documentation about it so people can build web manually.
Thank you for taking the time to read my discussion.
Beta Was this translation helpful? Give feedback.
All reactions