Skip to content

Commit 7db0fc0

Browse files
committed
dev: Run the service locally
Jira: IAM-1908
1 parent 508d593 commit 7db0fc0

4 files changed

Lines changed: 91 additions & 3 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ WORKDIR /usr/src/app
44
COPY . .
55
RUN cargo build --release
66

7-
FROM debian:11-slim
7+
FROM debian:13-slim
88

99
RUN apt-get update && apt-get install -y \
1010
ca-certificates \

Dockerfile.local

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
1-
FROM debian:10-slim
1+
# This is mostly the same as the regular Dockerfile build, except we cache
2+
# locally.
3+
FROM rust:latest
4+
5+
WORKDIR /usr/src/app
6+
COPY . .
7+
RUN --mount=type=cache,target=/usr/src/app/target/release/build \
8+
--mount=type=cache,target=/usr/src/app/target/release/deps \
9+
--mount=type=cache,target=/usr/src/app/target/release/incremental \
10+
--mount=type=cache,target=/usr/local/cargo/git \
11+
--mount=type=cache,target=/usr/local/cargo/registry \
12+
cargo build --release
13+
14+
FROM debian:13-slim
215

316
RUN apt-get update && apt-get install -y \
417
ca-certificates \
518
&& rm -rf /var/lib/apt/lists/*
619

720
WORKDIR /root/
8-
COPY target/release/dino-park-whoami .
21+
COPY --from=0 /usr/src/app/target/release/dino-park-whoami .
922
CMD ["./dino-park-whoami"]

dev/docker-compose.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This is used for local development only.
2+
3+
services:
4+
whoami:
5+
image: dino-park-whoami:development
6+
build:
7+
context: ../
8+
dockerfile: Dockerfile.local
9+
environment:
10+
DPW_SETTINGS: /root/.settings.json
11+
RUST_BACKTRACE: "1"
12+
volumes:
13+
- ../dev/settings.json:/root/.settings.json
14+
ports:
15+
- 127.0.0.1:8084:8084
16+
develop:
17+
watch:
18+
- path: ../src
19+
action: rebuild
20+
- path: ../Cargo.lock
21+
action: rebuild

dev/settings.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"comment": [
3+
"DEBT: The config parser expects all keys to be defined. It does not use",
4+
"the fallback to using the default values on `None`. This comment section",
5+
"is also a hack.",
6+
"See also:",
7+
"* src/settings.rs;",
8+
"* the `config` dependency."
9+
],
10+
"auth": "https://dev.mozilla-dev.auth0.com/",
11+
"cis": {
12+
"client_config": {
13+
"client_id": "",
14+
"client_secret": "",
15+
"audience": "",
16+
"token_endpoint": "https://idp",
17+
"scopes": "read:fullprofile display:all"
18+
},
19+
"sign_keys": {
20+
"source": "none"
21+
},
22+
"verify_keys": {
23+
"source": "none"
24+
},
25+
"change_api_user_endpoint": "https://change-api.cis",
26+
"change_api_users_endpoint": "https://change-api.cis",
27+
"person_api_user_endpoint": "https://person-api.cis",
28+
"person_api_users_endpoint": "https://person-api.cis"
29+
},
30+
"providers": {
31+
"github": {
32+
"client_id": "",
33+
"client_secret": ""
34+
},
35+
"bugzilla": {
36+
"client_id": "",
37+
"client_secret": "",
38+
"base_url": "https://bugzilla-dev.allizom.org"
39+
},
40+
"slack": {
41+
"client_id": "",
42+
"client_secret": "",
43+
"identity_redirect_uri": "http://dinopark/whoami/slack/auth/identity",
44+
"im_redirect_uri": "http://dinopark/whoami/slack/auth/im",
45+
"identity_scope": "identity.basic,identity.avatar,identity.email",
46+
"im_scope": "im:write,bot",
47+
"direct_message_uri": "https://mozilla.slack.com/messages/"
48+
}
49+
},
50+
"whoami": {
51+
"domain": "localhost",
52+
"secret": "1234567812345678deadbeefcafebabe1234567812345678"
53+
}
54+
}

0 commit comments

Comments
 (0)