NextDrought commited on
Commit
e9327ec
1 Parent(s): b4bdca9

using fastapi

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -37
Dockerfile CHANGED
@@ -1,38 +1,8 @@
1
- FROM node:20-alpine AS builder
2
- RUN apk add --no-cache libc6-compat
3
  WORKDIR /app
4
-
5
- # Install dependencies based on the preferred package manager
6
- COPY frontend .
7
- RUN \
8
- if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
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"]