-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile
40 lines (29 loc) · 929 Bytes
/
Dockerfile
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
FROM rust:1.70.0-bullseye as build
WORKDIR app
COPY ./lib ./lib
COPY ./.git ./.git
COPY ./locales ./locales
COPY ./Cargo.lock ./
COPY ./Cargo.toml ./
COPY ./tests ./tests
COPY ./scripts ./scripts
COPY ./jotoba_bin ./jotoba_bin
COPY ./LICENSE ./
RUN apt clean
RUN apt-get update --allow-releaseinfo-change -y
RUN apt upgrade -y
RUN apt install build-essential cmake pkg-config libssl-dev libleptonica-dev libtesseract-dev clang tesseract-ocr-jpn -y
# Build your program for release
RUN cargo build --release
RUN mv target/release/jotoba .
FROM debian:bullseye
WORKDIR app
RUN apt-get update --allow-releaseinfo-change -y
RUN apt upgrade -y
RUN apt install build-essential pkg-config cmake libssl-dev libleptonica-dev libtesseract-dev clang tesseract-ocr-jpn -y
COPY --from=build /app/jotoba .
COPY --from=build /app/locales ./locales
RUN useradd -s /bin/bash runuser
USER runuser
# Run the binary
CMD ["./jotoba","-s"]