-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
29 lines (22 loc) · 1.02 KB
/
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
#Dockerfile is used to create an image
#Set the base image.
FROM python:3.9-slim
# This is for interacting with a PostgreSQL database; we aren't doing that but one of my dependencies listed in
# requirements.txt requires libpq-dev, so it must be included.
RUN apt-get update
RUN apt-get install -y gcc libpq-dev
#Set the work directory in the container
WORKDIR /home
# copy the dependencies file to the working directory
COPY requirements.txt .
# Ensure pip is up to date
RUN pip install --upgrade pip
# install dependencies
RUN pip install -r requirements.txt
# copy the content of the local src directory to the working directory
COPY src/ .
# Define the entrypoint of the container. Passing arguments (known as the COMMAND) when running the
# container will be passed as arguments to the function. Ultimately what is executed is the ENTRYPOINT concatenated
# with the COMMAND. You may add custom options to ENTRYPOINT but note that those options will always be set when
# running in AWS.
ENTRYPOINT ["python","algorithm_example.py"]