2022-11-27 15:49:38 +00:00
|
|
|
# Generate iamge using Python base
|
|
|
|
FROM python:3.10.8-slim-buster
|
2022-11-27 15:12:05 +00:00
|
|
|
|
2022-11-27 15:49:38 +00:00
|
|
|
WORKDIR /usr/bin/app
|
|
|
|
|
|
|
|
# install required tools
|
|
|
|
RUN apt update && apt install -y curl
|
2022-11-27 15:12:05 +00:00
|
|
|
|
|
|
|
# Copy only the required files over
|
2022-11-27 16:07:46 +00:00
|
|
|
COPY set_ip.sh cloudflare_script.py config.ini cloudflare.json requirements.txt ./
|
2022-11-27 15:12:05 +00:00
|
|
|
|
2022-11-27 15:49:38 +00:00
|
|
|
RUN addgroup --system --gid 1001 pygroup
|
|
|
|
RUN adduser --system --uid 1001 pyapp
|
|
|
|
|
|
|
|
RUN chown -R pyapp:pygroup /usr/bin/app
|
|
|
|
|
|
|
|
USER pyapp
|
|
|
|
|
2022-11-27 16:07:46 +00:00
|
|
|
RUN pip install -r requirements.txt
|
2022-11-27 15:49:38 +00:00
|
|
|
|
2022-11-27 16:07:46 +00:00
|
|
|
CMD ["bash", "set_ip.sh", "docker"]
|