Changeset View
Changeset View
Standalone View
Standalone View
services/identity/Dockerfile
Show All 10 Lines | |||||
RUN rustup component add rustfmt | RUN rustup component add rustfmt | ||||
RUN mkdir -p /home/comm/app/identity | RUN mkdir -p /home/comm/app/identity | ||||
WORKDIR /home/comm/app/identity | WORKDIR /home/comm/app/identity | ||||
RUN cargo init --bin | RUN cargo init --bin | ||||
COPY services/identity/Cargo.toml services/identity/Cargo.lock ./ | COPY services/identity/Cargo.toml services/identity/Cargo.lock ./ | ||||
COPY shared/comm-opaque ../../shared/comm-opaque | COPY shared/comm-opaque ../../shared/comm-opaque | ||||
COPY shared/comm-opaque2 ../../shared/comm-opaque2 | |||||
# Cache build dependencies in a new layer | # Cache build dependencies in a new layer | ||||
RUN cargo build --release | RUN cargo build --release | ||||
RUN rm src/*.rs | RUN rm src/*.rs | ||||
COPY services/identity . | COPY services/identity . | ||||
COPY shared/protos/identity.proto ../../shared/protos/ | COPY shared/protos/identity.proto ../../shared/protos/ | ||||
# Remove the previously-built binary so that only the application itself is | # Remove the previously-built binary so that only the application itself is | ||||
# rebuilt | # rebuilt | ||||
RUN rm ./target/release/deps/identity* | RUN rm ./target/release/deps/identity* | ||||
RUN cargo build --release | RUN cargo build --release | ||||
RUN target/release/identity keygen | RUN target/release/identity keygen | ||||
CMD ["./target/release/identity", "server"] | CMD ["./target/release/identity", "server"] |