-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (35 loc) · 1.11 KB
/
Dockerfile
File metadata and controls
47 lines (35 loc) · 1.11 KB
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
FROM rust:slim-stretch as build
WORKDIR /service
RUN USER=root cargo new --bin enokey
WORKDIR /service/enokey
RUN apt-get update \
&& apt-get install -y libssl-dev pkg-config --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
RUN rustup install nightly-2019-07-09
COPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml
RUN cargo +nightly-2019-07-09 build
COPY ./Rocket.toml ./Rocket.toml
COPY ./src ./src
RUN touch src/main.rs
RUN cargo +nightly-2019-07-09 build
FROM debian:stretch-slim
WORKDIR /enokey
RUN mkdir keyfiles
RUN mkdir data
RUN apt-get update \
&& apt-get install -y libssl1.1 ca-certificates openssh-client --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /service/enokey/target/debug/enokey .
COPY ./static ./static
COPY ./templates ./templates
COPY ./Rocket.toml ./Rocket.toml
ENV ROCKET_ENV production
RUN adduser --disabled-password --gecos '' enokey
RUN mkdir /home/enokey/.ssh
RUN chown -R enokey /home/enokey/
RUN chown -R enokey .
COPY /docker-entrypoint.sh /
RUN chmod o+x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["./enokey"]