|
2 | 2 |
|
3 | 3 | > Member Management Service |
4 | 4 |
|
| 5 | +[](https://github.com/int-i/integer/releases/) |
5 | 6 | [](https://doc.rust-lang.org/edition-guide/rust-2018/index.html) |
6 | 7 | [](https://rocket.rs/) |
7 | 8 | [](https://www.postgresql.org/docs/13/index.html) |
|
48 | 49 | ### Requirement |
49 | 50 |
|
50 | 51 | - [Docker](https://www.docker.com/) |
| 52 | +- `db/password.txt` - a DB password file |
51 | 53 | - `cert.pem` - a certificate |
52 | 54 | - `key.pem` - a private key |
53 | 55 |
|
|
59 | 61 | $ docker build -t integer_api . |
60 | 62 | ``` |
61 | 63 |
|
62 | | -2. Create a Docker secret for `site.pem`: |
| 64 | +2. Create a Docker secret for `postgres_password`: |
| 65 | + |
| 66 | + ```bash |
| 67 | + $ docker secret create postgres_password db/password.txt |
| 68 | + ``` |
| 69 | + |
| 70 | +3. Create a Docker secret for `site.pem`: |
63 | 71 |
|
64 | 72 | ```bash |
65 | 73 | $ cat cert.pem key.pem | docker secret create site.pem - |
66 | 74 | ``` |
67 | 75 |
|
68 | | -3. Deploy the application to Docker Swarm |
| 76 | +4. Deploy the application to Docker Swarm: |
69 | 77 |
|
70 | 78 | ```bash |
71 | 79 | $ docker swarm init |
|
78 | 86 |
|
79 | 87 | #### GET /members/{id} |
80 | 88 |
|
81 | | -회원 정보 조회 |
| 89 | +Fetch member public information by the given member id. |
82 | 90 |
|
83 | 91 | ##### Output |
84 | 92 |
|
85 | 93 | ```json |
86 | 94 | { |
87 | 95 | "id": 12191765, |
88 | | - "name": "박승재", |
| 96 | + "name": "inti", |
89 | 97 | "admission_year": 19 |
90 | 98 | } |
91 | 99 | ``` |
92 | 100 |
|
93 | 101 | #### GET /members/{id}/contacts |
94 | 102 |
|
95 | | -회원 연락처 정보 조회 |
| 103 | +Fetch member contacts by the given member id. |
96 | 104 |
|
97 | 105 | ##### Output |
98 | 106 |
|
99 | 107 | ```json |
100 | 108 | { |
101 | 109 | "id": 12191234, |
102 | | - "name": "박승재", |
| 110 | + "name": "inti", |
103 | 111 | "admission_year": 19, |
104 | 112 | "phone": "010-1234-5678", |
105 | 113 | |
106 | 114 | } |
107 | 115 | ``` |
108 | 116 |
|
| 117 | +### Environment Variables |
| 118 | + |
| 119 | +- `DB_HOST` (optional, default: `localhost`) |
| 120 | +- `DB_NAME` (optional, default: `integer`) |
| 121 | +- `DB_USER` (required) |
| 122 | +- `DB_PASSWORD` (optional) |
| 123 | +- `DB_PASSWORD_FILE` (optional) |
| 124 | + |
| 125 | +Note: Integer requires either `DB_PASSWORD` or `DB_PASSWORD_FILE` to be set. |
| 126 | + |
109 | 127 | ## License |
110 | 128 |
|
111 | 129 | ```text |
|
0 commit comments