File size: 1,035 Bytes
38ec749
 
45a9387
38ec749
45a9387
b1d7217
722734e
45a9387
 
b1d7217
 
45a9387
b1d7217
38ec749
 
 
 
 
 
 
b1d7217
38ec749
 
b1d7217
38ec749
 
b1d7217
 
38ec749
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
FROM python:3.9

WORKDIR /app

COPY . .

RUN --mount=target=/tmp/packages.txt,source=packages.txt 	apt-get update && 	xargs -r -a /tmp/packages.txt apt-get install -y && 	apt-get install -y curl && 	curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && 	apt-get install -y nodejs && 	rm -rf /var/lib/apt/lists/* && apt-get clean
RUN ln -s /usr/lib/python3/dist-packages/uno.py /usr/local/lib/python3.9/site-packages/
RUN ln -s /usr/lib/python3/dist-packages/unohelper.py /usr/local/lib/python3.9/site-packages/


RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt

# Set up a new user named "user" with user ID 1000
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"]