Skip to content

Commit

Permalink
feat: add devcontainer support (openwallet-foundation#1282)
Browse files Browse the repository at this point in the history
Signed-off-by: Jason C. Leach <jason.leach@fullboar.ca>
  • Loading branch information
jleach committed Feb 15, 2023
1 parent efab8dd commit 4ac5332
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# arm + amd compatible Dockerfile
FROM ghcr.io/findy-network/findy-base:indy-1.16.ubuntu-18.04 AS indy-base

FROM ubuntu:18.04

# install indy deps and files from base
RUN apt-get update && apt-get install -y libsodium23 libssl1.1 libzmq5 git zsh

COPY --from=indy-base /usr/include/indy /usr/include/indy
COPY --from=indy-base /usr/lib/libindy.a /usr/lib/libindy.a
COPY --from=indy-base /usr/lib/libindy.so /usr/lib/libindy.so

RUN apt-get install -y curl python3 build-essential ca-certificates && \
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash && \
export NVM_DIR="$HOME/.nvm" && \
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
nvm install v16 && \
npm install yarn -g
7 changes: 7 additions & 0 deletions .devcontainer/devcontainer.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#
# Any environment variables that the container needs
# go in here.
#
# Example(s)
# GENESIS_TXN_PATH=/work/network/genesis/local-genesis.txn
#
8 changes: 8 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"build": {
"dockerfile": "Dockerfile"
},
"runArgs": ["--env-file", ".devcontainer/devcontainer.env"],
"workspaceMount": "source=${localWorkspaceFolder},target=/work,type=bind",
"workspaceFolder": "/work"
}
14 changes: 14 additions & 0 deletions DEVREADME.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

This file is intended for developers working on the internals of the framework. If you're just looking how to get started with the framework, see the [docs](./docs)

# Environment Setup

## VSCode devContainer

This project comes with a [.devcontainer](./devcontainer) to make it as easy as possible to setup your dev environment and begin contributing to this project.

All the [environment variables](https://code.visualstudio.com/remote/advancedcontainers/environment-variables) noted below can be added to [devcontainer.env](./devcontainer.env) and exposed to the development docker container.

When running in a container your project root directory will be `/work`. Use this to correctly path any environment variables, for example:

```console
GENESIS_TXN_PATH=/work/network/genesis/local-genesis.txn
```

## Running tests

Test are executed using jest. Some test require either the **mediator agents** or the **ledger** to be running. When running tests that require a connection to the ledger pool, you need to set the `TEST_AGENT_PUBLIC_DID_SEED` and `GENESIS_TXN_PATH` environment variables.
Expand Down

0 comments on commit 4ac5332

Please sign in to comment.