File size: 1,706 Bytes
1c1e321
 
 
 
 
 
 
 
 
 
 
4adb816
1c1e321
040bd2a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1c1e321
4adb816
 
 
 
 
78a316a
 
4adb816
 
 
 
 
 
 
1c1e321
 
 
 
 
 
 
 
 
040bd2a
1c1e321
0db0ed7
 
 
1c1e321
7ab4617
5ef293b
 
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Builder stage
FROM python:3.10.0 as builder

RUN useradd -ms /bin/bash admin

WORKDIR /srv
RUN chown -R admin:admin /srv
RUN chmod -R 755 /srv

# Install dependencies
RUN apt-get update && \
  apt-get install -y libu2f-udev libvulkan1 mesa-vulkan-drivers wget ffmpeg curl 

RUN apt-get install -y \
  fonts-liberation \
  libatk-bridge2.0-0 \
  libatk1.0-0 \
  libatspi2.0-0 \
  libcups2 \
  libdrm2 \
  libgbm1 \
  libgtk-3-0 \
  libnspr4 \
  libnss3 \
  libu2f-udev \
  libvulkan1 \
  libxcomposite1 \
  libxdamage1 \
  libxfixes3 \
  libasound2 \
  libxkbcommon0 \
  libxrandr2 \
  xdg-utils

# Download and install Thorium Browser
RUN wget https://github.com/Alex313031/thorium/releases/download/M117.0.5938.157/thorium-browser_117.0.5938.157_amd64.deb && \
  dpkg -i thorium-browser_117.0.5938.157_amd64.deb

# Install Node.js and npm
# Install NVM using sudo apt
RUN apt-get update && \
  apt-get install -y curl && \
  curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash

# Activate NVM in the current shell
SHELL ["/bin/bash", "--login", "-c"]
RUN source "$HOME/.nvm/nvm.sh" && \
  source "$HOME/.bashrc" && \
  nvm --version && \
  nvm install 18.17.0 && \
  nvm alias default 18.17.0 && \
  npm install -g npm@9.6.7
USER admin

# Copy the application code
COPY --chown=admin . /srv

# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt



# Remove Thorium Browser .deb package
RUN rm thorium-browser_117.0.5938.157_amd64.deb

# Command to run the application
CMD python -m uvicorn App.app:app --host 0.0.0.0 --port 7860 --workers 4 &  python -m celery -A App.Worker.celery worker -c 4 --loglevel=DEBUG

EXPOSE 7860