diff --git a/services/docker-compose.yml b/services/docker-compose.yml index ec68c3b26..d972f9e33 100644 --- a/services/docker-compose.yml +++ b/services/docker-compose.yml @@ -1,55 +1,68 @@ version: "3.9" networks: services-net: name: services-net services: + # tunnelbroker tunnelbroker-server: build: dockerfile: services/tunnelbroker/Dockerfile context: ../ args: - COMM_TEST_SERVICES=${COMM_TEST_SERVICES} image: commapp/tunnelbroker-server:0.2 container_name: tunnelbroker-server ports: - "${COMM_SERVICES_PORT_TUNNELBROKER}:50051" volumes: - $HOME/.aws/config:/root/.aws/config:ro - $HOME/.aws/credentials:/root/.aws/credentials:ro - ./tunnelbroker/tunnelbroker.ini:/root/tunnelbroker/tunnelbroker.ini:ro # backup backup-base: build: dockerfile: services/backup/docker-base/Dockerfile context: ../ image: commapp/backup-base:1.2 backup-server: networks: - services-net build: dockerfile: services/backup/docker-server/Dockerfile context: ../ args: - COMM_TEST_SERVICES=${COMM_TEST_SERVICES} - COMM_SERVICES_DEV_MODE=${COMM_SERVICES_DEV_MODE} image: commapp/backup-server:0.1 container_name: backup-server ports: - "${COMM_SERVICES_PORT_BACKUP}:50051" volumes: - $HOME/.aws/credentials:/root/.aws/credentials:ro + # blob blob-server: networks: - services-net build: dockerfile: services/blob/Dockerfile context: ../ args: - COMM_TEST_SERVICES=${COMM_TEST_SERVICES} - COMM_SERVICES_DEV_MODE=${COMM_SERVICES_DEV_MODE} image: commapp/blob-server:0.1 container_name: blob-server ports: - "${COMM_SERVICES_PORT_BLOB}:50051" volumes: - $HOME/.aws/credentials:/root/.aws/credentials:ro + # identity + identity-server: + networks: + - services-net + build: + dockerfile: services/identity/Dockerfile + context: ../ + image: commapp/identity-server:0.1 + container_name: identity-server + ports: + - "${COMM_SERVICES_PORT_IDENTITY}:50051" diff --git a/services/identity/Dockerfile b/services/identity/Dockerfile new file mode 100644 index 000000000..a1b448dd9 --- /dev/null +++ b/services/identity/Dockerfile @@ -0,0 +1,28 @@ +FROM rust:1.57 + +# Create a new user comm and use it to run subsequent commands +RUN useradd -m comm +USER comm + +RUN mkdir -p /home/comm/app/identity +WORKDIR /home/comm/app/identity +RUN cargo init --bin + +COPY services/identity/Cargo.toml services/identity/Cargo.lock ./ + +# Cache build dependencies in a new layer +RUN cargo build --release +RUN rm src/*.rs + +COPY services/identity . + +# Remove the previously-built binary so that only the application itself is +# rebuilt +RUN rm ./target/release/deps/identity* + +# The build.rs script depends on rustfmt +RUN rustup component add rustfmt + +RUN cargo build --release + +CMD ["./target/release/identity"]