Futi613 commited on
Commit
5cab9bd
·
verified ·
1 Parent(s): 85b5ffc

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -43
Dockerfile CHANGED
@@ -1,50 +1,13 @@
1
- # Use Node.js LTS Alpine as base image
2
- FROM node:18-alpine
3
 
4
- # Install system dependencies for Sharp, Canvas and native modules
5
- RUN apk add --no-cache \
6
- vips-dev \
7
- cairo-dev \
8
- pango-dev \
9
- giflib-dev \
10
- python3 \
11
- make \
12
- g++ \
13
- libc6-compat
14
-
15
- # Create app directory
16
  WORKDIR /app
17
 
18
- # Copy package files
19
- COPY package*.json ./
20
-
21
- # Install dependencies
22
- RUN npm ci
23
-
24
- # Copy source code
25
- COPY . .
26
-
27
- # Build the application
28
- RUN npm run build
29
-
30
- # Expose the port (Smithery typically uses 8080)
31
- EXPOSE 8080
32
-
33
- # Set environment variables
34
- ENV NODE_ENV=production
35
- ENV PORT=8080
36
 
37
- # Health check
38
- HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
39
- CMD node -e "console.log('Health check')" || exit 1
40
 
41
- # Create non-root user for security
42
- RUN addgroup -g 1001 -S nodejs && \
43
- adduser -S ddddocr -u 1001
44
 
45
- # Change ownership of the app directory
46
- RUN chown -R ddddocr:nodejs /app
47
- USER ddddocr
48
 
49
- # Start the application
50
- CMD ["npm", "start"]
 
1
+ FROM python:3.10-bookworm
 
2
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  WORKDIR /app
4
 
5
+ RUN apt update && apt install -y build-essential libglib2.0-0 libsm6 libxext6 libxrender-dev libgl1-mesa-glx
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
+ RUN git clone https://github.com/sml2h3/ddddocr.git
 
 
8
 
9
+ RUN cd ./ddddocr && pip install --no-cache-dir -r requirements.txt
 
 
10
 
11
+ RUN pip install fastapi uvicorn pydantic
 
 
12
 
13
+ CMD cd ddddocr && python -m ddddocr.__main__ api --host 0.0.0.0 --port 7860