File size: 828 Bytes
f006f31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM huggingface/transformers-pytorch-gpu as base
RUN pip install fastapi uvicorn pydantic pydantic-settings langdetect accelerate optimum pytest pytest-cov
RUN useradd -m -u 1000 user
WORKDIR /code

COPY --chown=user . /code
COPY logging.conf /code

ARG APP_ENV
ENV APP_ENV=${APP_ENV}
# Conditional commands based on APP_ENV
RUN if [ "$APP_ENV" = "dev" ]; then \
        echo "Force dev dependencies"; \
        pip install pytest pytest-cov; \
    fi

RUN mkdir -p /home/.cache/huggingface
RUN mkdir -p /.cache
RUN chmod -R 777 /home/.cache/huggingface
RUN chmod -R 777 /.cache
RUN mkdir -p /code/room_environment-classifier_onxx
RUN chmod -R 777 /code/room_environment-classifier_onxx

# Remove when settings getted from consul
# COPY .env /code

CMD ["uvicorn", "mappingservice.main:app","--host", "0.0.0.0", "--port", "80"]