chatgpt dockerfile
Browse files- Dockerfile +43 -50
Dockerfile
CHANGED
@@ -1,70 +1,63 @@
|
|
1 |
# Builder stage
|
2 |
FROM python:3.10.0-alpine as builder
|
3 |
|
4 |
-
|
|
|
5 |
|
|
|
6 |
WORKDIR /srv
|
7 |
-
RUN chown -R admin:admin /srv
|
8 |
-
|
9 |
-
|
10 |
-
# Install dependencies
|
11 |
-
RUN
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
|
|
|
|
|
|
|
|
34 |
|
35 |
# Copy the application code
|
36 |
COPY --chown=admin . /srv
|
37 |
|
38 |
-
#
|
39 |
-
|
40 |
-
RUN apt-get update && apt-get install -y \
|
41 |
-
software-properties-common \
|
42 |
-
npm
|
43 |
RUN npm install npm@latest -g && \
|
44 |
npm install n -g && \
|
45 |
n latest
|
46 |
|
|
|
|
|
|
|
47 |
|
48 |
-
|
49 |
-
RUN echo npm -v
|
50 |
-
RUN node -v
|
51 |
-
|
52 |
-
#install the stuff
|
53 |
-
# RUN cd /srv/Remotion-app && npm install
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
|
59 |
# Install Python dependencies
|
60 |
COPY requirements.txt .
|
61 |
RUN pip install --no-cache-dir -r requirements.txt
|
62 |
|
|
|
|
|
63 |
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
# Command to run the application
|
68 |
-
CMD 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
|
69 |
-
|
70 |
-
EXPOSE 7860
|
|
|
1 |
# Builder stage
|
2 |
FROM python:3.10.0-alpine as builder
|
3 |
|
4 |
+
# Create a non-root user
|
5 |
+
RUN adduser -D admin
|
6 |
|
7 |
+
# Set the working directory and adjust permissions
|
8 |
WORKDIR /srv
|
9 |
+
RUN chown -R admin:admin /srv && \
|
10 |
+
chmod -R 755 /srv
|
11 |
+
|
12 |
+
# Install system dependencies
|
13 |
+
RUN apk --no-cache add \
|
14 |
+
libu2f-dev \
|
15 |
+
vulkan-tools \
|
16 |
+
mesa-vulkan-radeon \
|
17 |
+
wget \
|
18 |
+
ffmpeg \
|
19 |
+
curl \
|
20 |
+
aria2 \
|
21 |
+
ttf-liberation \
|
22 |
+
at-spi2-atk \
|
23 |
+
atk \
|
24 |
+
cups-libs \
|
25 |
+
libdrm \
|
26 |
+
libgbm \
|
27 |
+
gtk3 \
|
28 |
+
nspr \
|
29 |
+
nss \
|
30 |
+
libu2f-host \
|
31 |
+
vulkan-loader \
|
32 |
+
libxcomposite \
|
33 |
+
libxdamage \
|
34 |
+
libxfixes \
|
35 |
+
alsa-lib \
|
36 |
+
libxkbcommon \
|
37 |
+
libxrandr \
|
38 |
+
xdg-utils \
|
39 |
+
npm
|
40 |
|
41 |
# Copy the application code
|
42 |
COPY --chown=admin . /srv
|
43 |
|
44 |
+
# Install Node.js and npm
|
|
|
|
|
|
|
|
|
45 |
RUN npm install npm@latest -g && \
|
46 |
npm install n -g && \
|
47 |
n latest
|
48 |
|
49 |
+
# Print Node.js and npm versions
|
50 |
+
RUN echo "Node.js version: $(node -v)" && \
|
51 |
+
echo "npm version: $(npm -v)"
|
52 |
|
53 |
+
# Install Thorium Browser or other dependencies if needed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
# Install Python dependencies
|
56 |
COPY requirements.txt .
|
57 |
RUN pip install --no-cache-dir -r requirements.txt
|
58 |
|
59 |
+
# Application Run Command
|
60 |
+
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"]
|
61 |
|
62 |
+
# Expose ports
|
63 |
+
EXPOSE 7860
|
|
|
|
|
|
|
|
|
|