Spaces:
Running
Running
NextDrought
commited on
Commit
•
e9327ec
1
Parent(s):
b4bdca9
using fastapi
Browse files- Dockerfile +7 -37
Dockerfile
CHANGED
@@ -1,38 +1,8 @@
|
|
1 |
-
FROM
|
2 |
-
|
3 |
WORKDIR /app
|
4 |
-
|
5 |
-
|
6 |
-
COPY
|
7 |
-
|
8 |
-
|
9 |
-
elif [ -f package-lock.json ]; then npm ci; \
|
10 |
-
elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \
|
11 |
-
else echo "Lockfile not found." && exit 1; \
|
12 |
-
fi
|
13 |
-
|
14 |
-
RUN npm run build
|
15 |
-
FROM python:3.10-slim AS backend
|
16 |
-
WORKDIR /app
|
17 |
-
|
18 |
-
RUN apt-get update && apt-get install --no-install-recommends -y \
|
19 |
-
git ffmpeg curl gnupg \
|
20 |
-
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
21 |
-
|
22 |
-
RUN useradd -m -u 1000 user
|
23 |
-
|
24 |
-
COPY ./requirements.txt .
|
25 |
-
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
|
26 |
-
|
27 |
-
USER user
|
28 |
-
ENV HOME=/home/user \
|
29 |
-
PATH=/home/user/.local/bin:$PATH
|
30 |
-
|
31 |
-
|
32 |
-
WORKDIR $HOME/app
|
33 |
-
COPY --from=builder /app/build ./static
|
34 |
-
COPY . .
|
35 |
-
|
36 |
-
CMD ["python", "app.py"]
|
37 |
-
|
38 |
-
|
|
|
1 |
+
FROM python:3.10.8-slim
|
2 |
+
LABEL description="Sentiment classifier of tweets service"
|
3 |
WORKDIR /app
|
4 |
+
COPY requirements.txt /app/requirements.txt
|
5 |
+
RUN pip install -r requirements.txt
|
6 |
+
COPY . /app/
|
7 |
+
EXPOSE 6000
|
8 |
+
CMD ["python", "app.py"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|