-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (28 loc) · 875 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
# Base Image - Determines Tensorflow/Cuda Version
FROM pytorch/pytorch:1.9.0-cuda10.2-cudnn7-runtime
### Environment settings
# User/Paths settings
ENV USER=averbis
ENV UID=1000
ENV HOME=/home/$USER
ENV PYTHONPATH "${PYTHONPATH}:$HOME/src"
ENV PATH "$PATH:$HOME/.local/bin"
# Update Container and install curl
RUN apt-get update \
&& apt-get full-upgrade -y
# User Setup
USER root
RUN adduser --disabled-password --gecos "Default user" --uid $UID $USER \
&& chown -R $UID $HOME \
&& chmod u+rwX $HOME
USER $USER
# Copy essential files to container
COPY requirements.txt $HOME
COPY averbis-nlp-service $HOME
# Install Python dependencies
WORKDIR $HOME
RUN pip install --force-reinstall -r requirements.txt
# Expose Port
EXPOSE 5000
# Start uvicorn server hosting the API
CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "5000"]