fix(executor): fix volume permissions on startup
Adds startup script that fixes /data volume ownership before starting Deno. This resolves permission errors after cache clear operations.
This commit is contained in:
parent
045ad36d14
commit
44606e2b78
2 changed files with 12 additions and 4 deletions
|
|
@ -4,7 +4,6 @@ FROM denoland/deno:1.39.0
|
||||||
# Install OpenSSH client for tools that need SSH access (e.g., exe-dev)
|
# Install OpenSSH client for tools that need SSH access (e.g., exe-dev)
|
||||||
USER root
|
USER root
|
||||||
RUN apt-get update && apt-get install -y openssh-client && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update && apt-get install -y openssh-client && rm -rf /var/lib/apt/lists/*
|
||||||
USER deno
|
|
||||||
|
|
||||||
# Set working directory
|
# Set working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
@ -12,11 +11,13 @@ WORKDIR /app
|
||||||
# Set Deno cache directory to use mounted volume
|
# Set Deno cache directory to use mounted volume
|
||||||
ENV DENO_DIR=/data
|
ENV DENO_DIR=/data
|
||||||
|
|
||||||
# Copy server file
|
# Copy server file and startup script
|
||||||
COPY server.ts .
|
COPY server.ts .
|
||||||
|
COPY start.sh .
|
||||||
|
RUN chmod +x start.sh
|
||||||
|
|
||||||
# Expose port (Railway will set PORT env var)
|
# Expose port (Railway will set PORT env var)
|
||||||
EXPOSE 3002
|
EXPOSE 3002
|
||||||
|
|
||||||
# Run the Deno server
|
# Run startup script that fixes permissions then starts Deno as deno user
|
||||||
CMD ["deno", "run", "--allow-net", "--allow-env", "--allow-read", "--allow-write", "--allow-run", "server.ts"]
|
CMD ["./start.sh"]
|
||||||
|
|
|
||||||
7
apps/railway-executor/start.sh
Normal file
7
apps/railway-executor/start.sh
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Fix permissions on the Deno cache directory (runs as root)
|
||||||
|
mkdir -p /data
|
||||||
|
chown -R deno:deno /data
|
||||||
|
|
||||||
|
# Switch to deno user and run the server
|
||||||
|
exec su deno -c "deno run --allow-net --allow-env --allow-read --allow-write --allow-run server.ts"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue