CDM_Demo / Dockerfile
wufan's picture
Upload Dockerfile
13974bb verified
raw
history blame
876 Bytes
FROM python:3.8
WORKDIR /code
RUN wget https://registry.npmmirror.com/-/binary/node/latest-v16.x/node-v16.13.1-linux-x64.tar.gz -o /code/node-v16.tar.gz \
&& tar -xvf node-v16.tar.gz \
&& mv node-v16 /usr/local/nodejs \
&& ln -s /usr/local/nodejs/bin/node /usr/local/bin \
&& ln -s /usr/local/nodejs/bin/npm /usr/local/bin \
&& node -v
COPY ./requriements.txt /code/requriements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requriements.txt
RUN useradd -m -u 1000 user
# Switch to the "user" user
USER user
# Set home to the user's home directory
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Set the working directory to the user's home directory
WORKDIR $HOME/app
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
COPY --chown=user . $HOME/app
CMD ["python", "app.py"]