Fix: Move start.sh COPY before USER switch to avoid permission error
This commit is contained in:
@@ -58,21 +58,22 @@ RUN adduser --system --uid 1001 astro
|
||||
# Copy application code
|
||||
COPY . .
|
||||
|
||||
|
||||
# Ensure migrations are included
|
||||
COPY migrations/ ./migrations/
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY package.json ./
|
||||
|
||||
# Copy startup script and make executable (before USER switch)
|
||||
COPY start.sh /app/start.sh
|
||||
RUN chmod +x /app/start.sh
|
||||
|
||||
# Security & Permissions
|
||||
USER astro
|
||||
|
||||
# Expose Port
|
||||
EXPOSE 4321
|
||||
|
||||
# Copy startup script and make executable
|
||||
COPY start.sh /app/start.sh
|
||||
RUN chmod +x /app/start.sh
|
||||
|
||||
# Launch with migrations + server
|
||||
CMD ["/app/start.sh"]
|
||||
|
||||
Reference in New Issue
Block a user