Member Management Service
- Rust
- libpq
libpq-dev
(Debian)postgresql-dev
(Alpine Linux)
-
Clone the repository:
$ git clone https://github.com/int-i/integer.git
-
Build the source:
$ cargo build
-
Run PostgreSQL:
$ docker-compose -f docker-compose.db.yml up -d
-
Run the application:
$ DB_USER=inti DB_PASSWORD=password cargo run
- Docker
db/password.txt
- the DB password filecert.pem
- the server certificateprivkey.pem
- the private key for the certificatechain.pem
- (Option) the intermediate certificate
-
Build the Docker image:
$ docker build -t integer_api .
or, use Alpine-based image:
$ docker build -f Dockerfile.alpine -t integer_api:alpine .
Note: If you use Alpine-based image on
aarch64-unknown-linux-musl
, install libc6-compat on final stage of Dockerfile.RUN apk add --no-cache libc6-compat
-
Create the Docker secrets:
$ docker secret create postgres_password db/password.txt $ cat cert.pem chain.pem privkey.pem | docker secret create site.pem -
postgres_password
site.pem
-
Deploy the application to Docker Swarm:
$ docker swarm init $ docker stack deploy -c docker-compose.yml inti
Fetch member public information by the given member id.
{
"id": 12191765,
"name": "inti",
"admission_year": 19
}
Fetch member contacts by the given member id.
{
"id": 12191234,
"name": "inti",
"admission_year": 19,
"phone": "010-1234-5678",
"email": "email@example.com"
}
DB_HOST
(optional, default:localhost
)DB_NAME
(optional, default:integer
)DB_USER
(required)DB_PASSWORD
(optional)DB_PASSWORD_FILE
(optional)
Note: Integer requires either DB_PASSWORD
or DB_PASSWORD_FILE
to be set.
Copyright 2021 Seungjae Park
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Integer is licensed under the Apache License 2.0.