12345678910111213141516171819202122232425262728293031 |
- FROM python:3.10-alpine
- RUN apk add --no-cache ffmpeg gcc libc-dev \
- && addgroup user \
- && adduser -s /bin/sh -h /app -G user -D user \
- && mkdir /config \
- && chown user:user /config
- USER user
- WORKDIR /app
- COPY --chown=user:user src/cool_bots/__about__.py src/cool_bots/__about__.py
- COPY --chown=user:user pyproject.toml README.md ./
- RUN python3 -m venv venv \
- && ./venv/bin/pip install pip-tools \
- && ./venv/bin/pip-compile -o ./requirements.txt pyproject.toml \
- && ./venv/bin/pip install -r ./requirements.txt \
- && rm ./requirements.txt \
- && pip uninstall pip-tools
- USER root
- RUN apk del -r gcc libc-dev
- USER user
- COPY --chown=user:user src/ src/
- RUN ./venv/bin/pip install -e .
- CMD ["sh", "-c", "printf '%s\n' ./venv/bin/*-bot"]
|