Skip to content

Commit

Permalink
Add Docker configuration files (line#14)
Browse files Browse the repository at this point in the history
* Add Docker configuration files

* Update README.md
  • Loading branch information
kj84park committed Nov 23, 2021
1 parent 84243b1 commit 3a75508
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM openjdk:8-jdk-alpine
WORKDIR /workspace/app
COPY . .
RUN ./rpserver/gradlew bootJar
RUN ./server/gradlew dockerBuild
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,16 @@ Basically, FIDO2 has the following operations - Registration, Authentication.
- Metadata service integration
- FIDO MDSv2

## How to play with
## How to run
You need to run the FIDO2 server and RP Server first.

If you want to integrate your own RP Server, please implement APIs by referring to the sample codes. Regarding client sides, you may implement the web app for communicating with the RP server.

We also provide our server in the form of a spring boot starter.
Check out the spring-boot-starter directory.

### Manual

```bash
# Start RP Server
cd rpserver
Expand All @@ -101,6 +103,14 @@ cd server
cd spring-boot-starter/line-fido2-spring-boot-demo
./gradlew bootRun
```
### Docker for demo
If the [Docker environment is configured](https://docs.docker.com/get-started/), You can easily run applications with docker-compose.

```bash
# Start both RP Server and FIDO2 Server
docker-compose up
```

After running the applications, you can open the test page at the link below.

**https://localhost:8080/**
Expand Down Expand Up @@ -145,6 +155,7 @@ After running the applications, you can view API guide documents at the link bel
- [FIDO at LINE: FIDO2 server as an open-source project](https://engineering.linecorp.com/en/blog/fido-at-line-fido2-server-opensource/)

`LINE DevDay Videos`
- [Open source contribution Starting with LINE FIDO2 Server](https://youtu.be/xKzXi5ic4Do)
- [Strong customer authentication & biometrics using FIDO](https://youtu.be/S1y9wFh7_dc)
- [Cross Platform Mobile Security At LINE](https://youtu.be/4288h-EamTU)
- [Secure LINE login with biometric key replacing password](https://youtu.be/vCAu-y-iwyw)
Expand Down
26 changes: 26 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version : "3.8"
services:
build:
container_name: build-image
image: build-image:latest
build:
context: .
dockerfile: ./Dockerfile
rp:
container_name: rp-server
image: rp:latest
build:
context: .
dockerfile: ./rpserver/Dockerfile
ports:
- "8080:8080"
restart: always
fido2:
container_name: fido2-server
image: fido2:latest
build:
context: .
dockerfile: ./server/Dockerfile
ports:
- "8081:8081"
restart: always
4 changes: 4 additions & 0 deletions rpserver/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM openjdk:8-jdk-alpine
EXPOSE 8080
COPY --from=build-image:latest /workspace/app/rpserver/build/libs/rpserver-*.jar rpserver.jar
ENTRYPOINT ["java","-jar","-Dspring.profiles.active=docker","/rpserver.jar"]
21 changes: 21 additions & 0 deletions rpserver/src/main/resources/application-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
spring:
profiles:
active: docker
resources:
chain:
cache: false
fido2:
rp:
id: localhost
origin: localhost
port: 8080
conformance:
url: https://localhost:8080
logging:
level:
org.springframework.web: DEBUG
org.hibernate: DEBUG
com.linecorp.line: DEBUG
fido2-server:
host: fido2

4 changes: 4 additions & 0 deletions server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM openjdk:8-jdk-slim
EXPOSE 8081
COPY --from=build-image:latest /workspace/app/server/build/libs/server-*.jar server.jar
ENTRYPOINT ["java","-jar","/server.jar"]
5 changes: 5 additions & 0 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ task makeRestDocs(type: Copy) {
into file('src/main/resources/static/docs')
}

task dockerBuild() {
jar.enabled = false
dependsOn(bootJar)
}

dependencies {
implementation('org.springframework.boot:spring-boot-starter-data-jpa')
implementation('org.springframework.boot:spring-boot-starter-data-redis')
Expand Down

0 comments on commit 3a75508

Please sign in to comment.