File tree Expand file tree Collapse file tree 6 files changed +52
-6
lines changed
Expand file tree Collapse file tree 6 files changed +52
-6
lines changed Original file line number Diff line number Diff line change 1+ # ###################################################################################################
2+ # # Builder
3+ # ###################################################################################################
4+ FROM rust:1.70 AS builder
5+
6+ RUN rustup target add x86_64-unknown-linux-musl
7+ RUN apt update && apt install -y musl-tools musl-dev
8+
9+ RUN addgroup --gid 10001 --system nonroot \
10+ && adduser --uid 10000 --system --ingroup nonroot --home /home/nonroot nonroot
11+
12+ WORKDIR /regan
13+
14+ COPY ./ .
15+ RUN cargo build --target x86_64-unknown-linux-musl --release
16+
17+ # ###################################################################################################
18+ # # Final image
19+ # ###################################################################################################
20+ FROM scratch
21+
22+ COPY --from=builder /etc/passwd /etc/passwd
23+ COPY --from=builder /etc/group /etc/group
24+
25+ WORKDIR /regan
26+
27+ COPY --from=builder /regan/target/x86_64-unknown-linux-musl/release/server ./
28+ COPY --from=builder /regan/static/ ./static/
29+
30+ USER nonroot:nonroot
31+
32+ ENTRYPOINT ["/regan/server" ]
33+
34+ CMD ["--image-dir" , "/var/regan/images/" ,\
35+ "--port" , "80" , \
36+ "--output" , "/var/regan/results.db" ]
Original file line number Diff line number Diff line change @@ -24,6 +24,16 @@ The server provides a platform for comparing images. It will select images from
2424
2525The matchmaking strategy of the server tries to select those images with the highest uncertainty about their rank.
2626
27+ #### Server with Docker
28+ A Dockerfile is provided for people who want to use docker for hosting the server.
29+ You have to define volumes for the input images (at least read access) and a directoy, where the sqlite database is written.
30+ Also, port publish is also needed.
31+ An example on how to run it with docker where ` YOUR_DIRECTOY/images ` contains images
32+ ```
33+ docker build -t regan .
34+ docker run -v <YOUR_DIRECTORY>:/var/regan/ -p <HOST_PORT>:80/tcp regan
35+ ```
36+
2737#### Parameters
2838Use ` --help ` to see the parameter documentation
2939
Original file line number Diff line number Diff line change 11[package ]
22name = " image_collection"
3- version = " 0.2.0 "
3+ version = " 0.2.1 "
44edition = " 2021"
55
66[lib ]
Original file line number Diff line number Diff line change 11[package ]
22name = " server"
3- version = " 0.2.0 "
3+ version = " 0.2.1 "
44edition = " 2021"
55
66# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Original file line number Diff line number Diff line change 11[package ]
22name = " simulation"
3- version = " 0.2.0 "
3+ version = " 0.2.1 "
44edition = " 2021"
55
66# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
You can’t perform that action at this time.
0 commit comments