Dockerfile 562 B

12345678910111213141516171819202122232425262728
  1. FROM node:22-bookworm
  2. RUN apt-get update && apt-get install -y \
  3. git \
  4. curl \
  5. ffmpeg \
  6. && rm -rf /var/lib/apt/lists/*
  7. # Set up non-root user
  8. ARG USERNAME=node
  9. ARG USER_UID=1000
  10. ARG USER_GID=$USER_UID
  11. # Create the user if it doesn't exist
  12. RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then \
  13. groupmod --gid $USER_GID $USERNAME \
  14. && usermod --uid $USER_UID --gid $USER_GID $USERNAME; \
  15. fi
  16. # Set up workspace
  17. WORKDIR /workspace
  18. RUN chown $USERNAME:$USERNAME /workspace
  19. COPY . .
  20. EXPOSE 3000
  21. USER $USERNAME