Dockerfile 818 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. ARG src_path=backend/ecs_tasks/delete_files
  2. ARG layers_path=backend/lambda_layers
  3. FROM python:3.9-slim as base
  4. RUN apt-get update --fix-missing
  5. RUN apt-get -y install g++ gcc libsnappy-dev
  6. FROM base as builder
  7. ARG src_path
  8. ARG layers_path
  9. RUN mkdir /install
  10. WORKDIR /install
  11. COPY $src_path/requirements.txt /requirements.txt
  12. RUN pip3 install \
  13. -r /requirements.txt \
  14. -t /install \
  15. --compile \
  16. --no-cache-dir
  17. FROM base
  18. ARG src_path
  19. ARG layers_path
  20. RUN groupadd -r s3f2 && useradd --no-log-init -r -m -g s3f2 s3f2
  21. USER s3f2
  22. RUN mkdir /home/s3f2/app
  23. RUN echo ${src_path}
  24. COPY --from=builder /install /home/s3f2/.local/lib/python3.9/site-packages/
  25. WORKDIR /home/s3f2/app
  26. COPY $src_path/* \
  27. $layers_path/boto_utils/python/boto_utils.py \
  28. /home/s3f2/app/
  29. CMD ["python3", "-u", "main.py"]