Dockerfile 748 B

12345678910111213141516171819202122232425262728293031
  1. FROM python:3.10-alpine
  2. RUN apk add --no-cache ffmpeg gcc libc-dev \
  3. && addgroup user \
  4. && adduser -s /bin/sh -h /app -G user -D user \
  5. && mkdir /config \
  6. && chown user:user /config
  7. USER user
  8. WORKDIR /app
  9. COPY --chown=user:user src/cool_bots/__about__.py src/cool_bots/__about__.py
  10. COPY --chown=user:user pyproject.toml README.md ./
  11. RUN python3 -m venv venv \
  12. && ./venv/bin/pip install pip-tools \
  13. && ./venv/bin/pip-compile -o ./requirements.txt pyproject.toml \
  14. && ./venv/bin/pip install -r ./requirements.txt \
  15. && rm ./requirements.txt \
  16. && pip uninstall pip-tools
  17. USER root
  18. RUN apk del -r gcc libc-dev
  19. USER user
  20. COPY --chown=user:user src/ src/
  21. RUN ./venv/bin/pip install -e .
  22. CMD ["sh", "-c", "printf '%s\n' ./venv/bin/*-bot"]