-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
50 lines (25 loc) · 837 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM python:3.10-slim-buster
RUN pip install --upgrade pip
WORKDIR /app
COPY . /app
#set permissions
RUN chmod +x /app/tests
RUN chmod +w /app/tests
RUN chmod +x /app/prediction_model
RUN chmod +w /app/prediction_model/trained_models
RUN chmod +w /app/prediction_model/datasets
ENV PYTHONPATH "${PYTHONPATH}:/app/prediction_model"
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install dvc[s3]
# AWS credentials
ARG AWS_ACCESS_KEY_ID
ARG AWS_SECRET_ACCESS_KEY
ENV AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
ENV AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
RUN dvc pull --force
RUN python /app/prediction_model/training_pipeline.py
RUN pytest -v /app/tests/test_prediction.py
RUN pytest --junitxml=/app/tests/test-results.xml /app/tests/test_prediction.py
EXPOSE 8005
ENTRYPOINT ["python"]
CMD ["main.py"]