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 application code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
|
||||||
# Ensure migrations are included
|
# Ensure migrations are included
|
||||||
COPY migrations/ ./migrations/
|
COPY migrations/ ./migrations/
|
||||||
COPY --from=builder /app/dist ./dist
|
COPY --from=builder /app/dist ./dist
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY package.json ./
|
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
|
# Security & Permissions
|
||||||
USER astro
|
USER astro
|
||||||
|
|
||||||
# Expose Port
|
# Expose Port
|
||||||
EXPOSE 4321
|
EXPOSE 4321
|
||||||
|
|
||||||
# Copy startup script and make executable
|
|
||||||
COPY start.sh /app/start.sh
|
|
||||||
RUN chmod +x /app/start.sh
|
|
||||||
|
|
||||||
# Launch with migrations + server
|
# Launch with migrations + server
|
||||||
CMD ["/app/start.sh"]
|
CMD ["/app/start.sh"]
|
||||||
|
|||||||
Reference in New Issue
Block a user