-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Docker image and docker-compose example
- Loading branch information
1 parent
60382ee
commit 84ddcad
Showing
6 changed files
with
120 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
npm-debug.log | ||
examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM node:10 | ||
WORKDIR /usr/src/app | ||
COPY . . | ||
RUN yarn | ||
RUN yarn bootstrap | ||
RUN yarn build | ||
ENTRYPOINT ["./packages/daf-cli/bin/daf.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Usage | ||
|
||
## Help | ||
|
||
``` | ||
docker-compose run daf -h | ||
``` | ||
|
||
## Create identity | ||
|
||
``` | ||
docker-compose run daf identity-manager -c | ||
``` | ||
|
||
|
||
## Start GraphQL server | ||
|
||
``` | ||
docker-compose up -d | ||
``` | ||
|
||
open http://localhost:8080 | ||
|
||
If you set `DAF_GRAPHQL_API_KEY` in `docker-compose.yml`, you will need to add HTTP `Authorization` header to your GraphQL API calls. | ||
Example: | ||
|
||
``` | ||
DAF_GRAPHQL_API_KEY=ABC123 | ||
``` | ||
|
||
``` | ||
{ | ||
"Authorization": "Bearer ABC123" | ||
} | ||
``` | ||
|
||
|
||
|
||
## Stop | ||
|
||
``` | ||
docker-compose down | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
var fs = require('fs') | ||
|
||
module.exports = { | ||
identityProviders: [ | ||
{ | ||
package: 'daf-ethr-did', | ||
network: 'rinkeby', | ||
rpcUrl: 'https://rinkeby.infura.io/v3/' + process.env.DAF_INFURA_ID, | ||
gas: 10001, | ||
ttl: 60 * 60 * 24 * 30 * 12 + 1, | ||
}, | ||
{ | ||
package: 'daf-elem-did', | ||
network: 'ropsten', | ||
apiUrl: 'https://element-did.com/api/v1/sidetree', | ||
}, | ||
], | ||
ethrDidNetworks: [ | ||
{ | ||
name: 'mainnet', | ||
rpcUrl: 'https://mainnet.infura.io/v3/' + process.env.DAF_INFURA_ID | ||
}, | ||
{ | ||
name: 'rinkeby', | ||
rpcUrl: 'https://rinkeby.infura.io/v3/' + process.env.DAF_INFURA_ID | ||
}, | ||
|
||
], | ||
// https://typeorm.io/#/connection-options | ||
database: { | ||
type: 'sqlite', | ||
synchronize: !fs.existsSync(process.env.DAF_DATA_STORE), | ||
database: process.env.DAF_DATA_STORE, | ||
logging: process.env.DAF_DEBUG_DB === 'true' ? true : false, | ||
migrationsRun: true, | ||
}, | ||
graphql: { | ||
apiKey: process.env.DAF_GRAPHQL_API_KEY, | ||
resolvers: { | ||
IdentityManager: true, | ||
TrustGraph: false, | ||
DIDComm: true, | ||
W3c: true, | ||
Sdr: true, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: "3" | ||
|
||
services: | ||
daf: | ||
image: uport/daf:latest | ||
ports: | ||
- 8080:8080/tcp | ||
environment: | ||
- DAF_CONFIG=/config/config.js | ||
- DAF_DATA_STORE=/config/database.sqlite | ||
- DAF_GRAPHQL_API_KEY= | ||
- DAF_INFURA_ID=5ffc47f65c4042ce847ef66a3fa70d4c | ||
- DAF_SECRET_KEY=d72629cfd01e8e64762808a37e29d63103ef5cb7e92888afb9d4c0a6426c933e | ||
command: | ||
[ | ||
"graphql", | ||
"--port=8080" | ||
] | ||
volumes: | ||
- .:/config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters