LOOFYYLO commited on
Commit
3fbe6f7
·
verified ·
1 Parent(s): c0acdbc

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -33
Dockerfile CHANGED
@@ -1,47 +1,26 @@
1
 
2
- # Stage 1: Build the Rust core library
3
- FROM rust:latest as builder
4
 
5
- WORKDIR /app
 
 
 
 
6
 
7
- # Copy only the necessary files to build the Rust library
 
8
  COPY laa_core /app/laa_core
9
  RUN cd laa_core && cargo build --release
10
 
11
- # Stage 2: Build the Python application
12
  FROM python:3.9-slim
13
 
14
  WORKDIR /app
15
 
16
- # Install system dependencies for Playwright
17
- RUN apt-get update && apt-get install -y \
18
- libgtk-4-1 \
19
- libgraphene-1.0-0 \
20
- libxslt1.1 \
21
- libwoff1 \
22
- libvpx9 \
23
- libevent-2.1-7 \
24
- libopus0 \
25
- libgstreamer-plugins-base1.0-0 \
26
- libgstreamer1.0-0 \
27
- libgstreamer-gl1.0-0 \
28
- libgstreamer-plugins-bad1.0-0 \
29
- flite \
30
- libwebpdemux2 \
31
- libavif16 \
32
- libharfbuzz-icu0 \
33
- libwebp7 \
34
- libenchant-2-2 \
35
- libsecret-1-0 \
36
- libhyphen0 \
37
- libmanette-0.2-0 \
38
- x264 \
39
- && rm -rf /var/lib/apt/lists/*
40
-
41
  # Install Python dependencies
42
- COPY requirements.txt .
43
- RUN pip install --no-cache-dir -r requirements.txt
44
- RUN pip install playwright && playwright install
45
 
46
  # Copy the built Rust library from the builder stage
47
  COPY --from=builder /app/laa_core/target/release/liblaa_core.so /app/laa_core.so
 
1
 
2
+ # Stage 1: Build the Rust core library in a full-featured environment
3
+ FROM python:3.9 as builder
4
 
5
+ # Install rustup and the Rust toolchain
6
+ ENV RUSTUP_HOME=/usr/local/rustup \
7
+ CARGO_HOME=/usr/local/cargo \
8
+ PATH=/usr/local/cargo/bin:$PATH
9
+ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
10
 
11
+ # Copy the Rust project and build it
12
+ WORKDIR /app
13
  COPY laa_core /app/laa_core
14
  RUN cd laa_core && cargo build --release
15
 
16
+ # Stage 2: Create the final, minimal production image
17
  FROM python:3.9-slim
18
 
19
  WORKDIR /app
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  # Install Python dependencies
22
+ COPY requirements-hf.txt .
23
+ RUN pip install --no-cache-dir -r requirements-hf.txt
 
24
 
25
  # Copy the built Rust library from the builder stage
26
  COPY --from=builder /app/laa_core/target/release/liblaa_core.so /app/laa_core.so