-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.gpu
71 lines (52 loc) · 3.19 KB
/
Dockerfile.gpu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Frontend build stage
FROM node:19-alpine as frontend
WORKDIR /app
COPY frontend-summarization/package*.json ./
RUN npm install
COPY frontend-summarization .
RUN npm run build
# Use a Rust base image
FROM nvidia/cuda:11.0.3-runtime-ubuntu20.04
# Update the package repository and install dependencies
# Get Ubuntu packages
# Update new packages
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN apt-get update
RUN apt-get install -y -q
RUN apt-get install dialog apt-utils -y
RUN apt-get install -y \
build-essential \
curl \
pkg-config \
libssl-dev
# Get Rust
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
# Add .cargo/bin to PATH
ENV PATH="/root/.cargo/bin:${PATH}"
ENV TORCH_CUDA_VERSION="cu117"
# Check cargo is visible
RUN cargo --help
## Add the PyTorch repository
#RUN add-apt-repository ppa:ubuntu-toolchain-r/test
# Update the package repository and install PyTorch
# Set the working directory
WORKDIR /app
#RUN curl -LJO https://download.pytorch.org/libtorch/cu117/libtorch-cxx11-abi-shared-with-deps-1.13.1%2Bcu117.zip && unzip libtorch-cxx11-abi-shared-with-deps-1.13.1%2Bcu117.zip
#RUN curl -LJO https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.13.1%2Bcpu.zip && unzip libtorch-cxx11-abi-shared-with-deps-1.13.1%2Bcpu.zip
# Copy the application code
COPY . .
#ENV LIBTORCH='/app/libtorch'
#ENV LD_LIBRARY_PATH='${LIBTORCH}/lib:$LD_LIBRARY_PATH'
COPY --from=frontend /app/dist/ ./dist/
#COPY /app/dist/ ./dist/
RUN make test
# Build the application
RUN cargo build --release
# Expose the application port
EXPOSE 8000
# Set the command to run when the container starts
#CMD ["./target/release/rust-new-project-template"]
#CMD ["./target/release/rust-new-project-template","text","-i", "The Chinese monarchy collapsed in 1912 with the Xinhai Revolution, when the Republic of China (ROC) replaced the Qing dynasty. In its early years as a republic, the country underwent a period of instability known as the \"Warlord Era\" before mostly reunifying in 1928 under a Nationalist government. A civil war between the nationalist Kuomintang (KMT) and the Chinese Communist Party (CCP) began in 1927. Japan invaded China in 1937, starting the Second Sino-Japanese War and temporarily halting the civil war. The surrender and expulsion of Japanese forces from China in 1945 left a power vacuum in the country, which led to renewed fighting between the CCP and the Kuomintang."]
#ENTRYPOINT ["cargo","run","--release", "text","-i"]
#CMD ["The Chinese monarchy collapsed in 1912 with the Xinhai Revolution, when the Republic of China (ROC) replaced the Qing dynasty. In its early years as a republic, the country underwent a period of instability known as the \"Warlord Era\" before mostly reunifying in 1928 under a Nationalist government. A civil war between the nationalist Kuomintang (KMT) and the Chinese Communist Party (CCP) began in 1927. Japan invaded China in 1937, starting the Second Sino-Japanese War and temporarily halting the civil war. The surrender and expulsion of Japanese forces from China in 1945 left a power vacuum in the country, which led to renewed fighting between the CCP and the Kuomintang."]
CMD ["cargo", "run", "--release"]