File size: 1,249 Bytes
1c1e321
aeb8823
1c1e321
a4bcb74
 
1c1e321
a4bcb74
1c1e321
a4bcb74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
040bd2a
a913311
 
 
a4bcb74
07dca11
 
 
a913311
a4bcb74
 
 
a913311
a4bcb74
1c1e321
 
 
 
 
a4bcb74
 
040bd2a
a4bcb74
 
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
# Builder stage
FROM python:3.10.0-alpine as builder

# Create a non-root user
RUN adduser -D admin

# Set the working directory and adjust permissions
WORKDIR /srv
RUN chown -R admin:admin /srv && \
  chmod -R 755 /srv

# Install system dependencies
RUN apk --no-cache add \
  libu2f-dev \
  vulkan-tools \
  mesa-vulkan-radeon \
  wget \
  ffmpeg \
  curl \
  aria2 \
  ttf-liberation \
  at-spi2-atk \
  atk \
  cups-libs \
  libdrm \
  libgbm \
  gtk3 \
  nspr \
  nss \
  libu2f-host \
  vulkan-loader \
  libxcomposite \
  libxdamage \
  libxfixes \
  alsa-lib \
  libxkbcommon \
  libxrandr \
  xdg-utils \
  npm

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

# Install Node.js and npm
RUN npm install npm@latest -g && \
  npm install n -g && \
  n latest

# Print Node.js and npm versions
RUN echo "Node.js version: $(node -v)" && \
  echo "npm version: $(npm -v)"

# Install Thorium Browser or other dependencies if needed

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

# Application Run Command
CMD ["bash", "-c", "python -m uvicorn App.app:app --host 0.0.0.0 --port 7860 & python -m celery -A App.Worker.celery worker -c 4 --loglevel=info"]

# Expose ports
EXPOSE 7860