forked from DSGT-DLP/Deep-Learning-Playground
-
Notifications
You must be signed in to change notification settings - Fork 4
/
TrainingContainer.Dockerfile
55 lines (38 loc) · 1.3 KB
/
TrainingContainer.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
49
50
51
52
53
54
55
FROM python:3.9-slim
WORKDIR /
# Install Poetry
RUN pip install poetry
# Install gcc
RUN apt-get update && apt-get install -y gcc
# Install curl
RUN apt-get install -y curl
# Install unzip
RUN apt-get install -y unzip
# Checking poetry version
RUN poetry --version
# Copy the project files
COPY backend/pyproject.toml backend/poetry.lock ./backend/
# Change working directory to the backend subdirectory
WORKDIR /backend
# Install prod dependencies
RUN poetry install --no-interaction --no-ansi --no-root --no-dev
# Copy the rest of the project
COPY backend/ ./
ARG TARGETARCH
RUN if [ "${TARGETARCH}" = "arm64" ] ; then \
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" ; \
else \
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" ; \
fi
RUN unzip awscliv2.zip
RUN ./aws/install
ARG AWS_REGION
ARG AWS_DEPLOY_ACCESS_KEY_ID
ARG AWS_DEPLOY_SECRET_ACCESS_KEY
RUN aws configure set region $AWS_REGION
RUN aws configure set aws_access_key_id $AWS_DEPLOY_ACCESS_KEY_ID
RUN aws configure set aws_secret_access_key $AWS_DEPLOY_SECRET_ACCESS_KEY
ENV SQS_QUEUE_URL='https://sqs.us-west-2.amazonaws.com/521654603461/dlp-training-queue'
# Set the working directory to /backend
WORKDIR /backend
CMD poetry run python -m common.kernel