Update Cloudron app configuration and setup
This commit is contained in:
29
Dockerfile
29
Dockerfile
@ -12,8 +12,10 @@ RUN apt-get update && apt-get install -y git && \
|
||||
RUN corepack enable
|
||||
|
||||
# Set environment variables for web app build
|
||||
# Will be overridden at runtime with the actual server endpoint
|
||||
ENV NEXT_PUBLIC_ENTE_ENDPOINT="https://localhost:8080"
|
||||
# Use "/api" as the endpoint which will be replaced at runtime with the full URL
|
||||
ENV NEXT_PUBLIC_ENTE_ENDPOINT="/api"
|
||||
# Add a note for clarity
|
||||
RUN echo "Building with NEXT_PUBLIC_ENTE_ENDPOINT=/api, will be replaced at runtime with full URL"
|
||||
|
||||
# Debugging the repository structure
|
||||
RUN find . -type d -maxdepth 3 | sort
|
||||
@ -78,8 +80,14 @@ FROM cloudron/base:5.0.0@sha256:04fd70dbd8ad6149c19de39e35718e024417c3e01dc9c663
|
||||
|
||||
# Install necessary packages (excluding golang as we'll install it manually)
|
||||
RUN apt-get update && \
|
||||
apt-get install -y curl git nodejs npm libsodium23 libsodium-dev pkg-config nginx && \
|
||||
apt-get install -y curl git nodejs npm libsodium23 libsodium-dev pkg-config postgresql-client && \
|
||||
npm install -g yarn serve && \
|
||||
# Install Caddy instead of NGINX
|
||||
apt-get install -y debian-keyring debian-archive-keyring apt-transport-https && \
|
||||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg && \
|
||||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-stable.list && \
|
||||
apt-get update && \
|
||||
apt-get install -y caddy && \
|
||||
apt-get clean && apt-get autoremove && \
|
||||
rm -rf /var/cache/apt /var/lib/apt/lists
|
||||
|
||||
@ -103,6 +111,17 @@ RUN git clone --depth=1 https://github.com/ente-io/ente.git . && \
|
||||
cp -r server/go.mod server/go.sum /app/data/go/ && \
|
||||
chmod 777 /app/data/go/go.mod /app/data/go/go.sum
|
||||
|
||||
# Pre-download Go dependencies
|
||||
RUN cd server && \
|
||||
export GOMODCACHE="/app/data/go/pkg/mod" && \
|
||||
export GOFLAGS="-modfile=/app/data/go/go.mod -mod=mod" && \
|
||||
export GOTOOLCHAIN=local && \
|
||||
export GO111MODULE=on && \
|
||||
export GOSUMDB=off && \
|
||||
mkdir -p /app/data/go/pkg/mod && \
|
||||
chmod -R 777 /app/data/go && \
|
||||
go mod download
|
||||
|
||||
# Set Go environment variables
|
||||
ENV GOTOOLCHAIN=local
|
||||
ENV GO111MODULE=on
|
||||
@ -127,8 +146,8 @@ RUN chmod +x /app/pkg/start.sh
|
||||
# Create NGINX directories
|
||||
RUN mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled
|
||||
|
||||
# Expose the web port (Cloudron expects port 8080)
|
||||
EXPOSE 8080
|
||||
# Expose the web port (Cloudron expects port 3080 now)
|
||||
EXPOSE 3080
|
||||
|
||||
# Start the application
|
||||
CMD ["/app/pkg/start.sh"]
|
Reference in New Issue
Block a user