-
Notifications
You must be signed in to change notification settings - Fork 0
/
Containerfile
44 lines (37 loc) · 2.39 KB
/
Containerfile
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
# Use the same base image version as the clams-python python library version
FROM ghcr.io/clamsproject/clams-python-ffmpeg-torch2:1.3.0
# See https://github.com/orgs/clamsproject/packages?tab=packages&q=clams-python for more base images
# IF you want to automatically publish this image to the clamsproject organization,
# 1. you should have generated this template without --no-github-actions flag
# 1. to add arm64 support, change relevant line in .github/workflows/container.yml
# * NOTE that a lots of software doesn't install/compile or run on arm64 architecture out of the box
# * make sure you locally test the compatibility of all software dependencies before using arm64 support
# 1. use a git tag to trigger the github action. You need to use git tag to properly set app version anyway
################################################################################
# DO NOT EDIT THIS SECTION
ARG CLAMS_APP_VERSION
ENV CLAMS_APP_VERSION ${CLAMS_APP_VERSION}
################################################################################
################################################################################
# This is duplicate from the base image Containerfile
# but makes sure the cache directories are consistent across all CLAMS apps
# https://github.com/openai/whisper/blob/ba3f3cd54b0e5b8ce1ab3de13e32122d0d5f98ab/whisper/__init__.py#L130
ENV XDG_CACHE_HOME='/cache'
# https://huggingface.co/docs/huggingface_hub/main/en/package_reference/environment_variables#hfhome
ENV HF_HOME="/cache/huggingface"
# https://pytorch.org/docs/stable/hub.html#where-are-my-downloaded-models-saved
ENV TORCH_HOME="/cache/torch"
RUN mkdir /cache ; rm -rf /root/.cache ; ln -s /cache /root/.cache
################################################################################
################################################################################
# clams-python base images are based on debian distro
# install more system packages as needed using the apt manager
################################################################################
################################################################################
# main app installation
COPY ./ /app
WORKDIR /app
RUN pip3 install --no-cache-dir -r requirements.txt
# default command to run the CLAMS app in a production server
CMD ["python3", "app.py", "--production"]
################################################################################