diff --git a/.devcontainer/.env b/.devcontainer/.env new file mode 100644 index 00000000..7b969762 --- /dev/null +++ b/.devcontainer/.env @@ -0,0 +1,16 @@ +# wf.database +MONGODB_URL='localhost' +MONGODB_PORT='27017' +MONDODB_DATABASE='openwf' +MONDODB_USERNAME='root' +MONDODB_PASSWORD='database' + +# wf.server logs +LOG_LEVEL=trace +LOG_FILES=true + +# Log Types +# fatal, error, warn, info, http, debug, trace + +# Edit the following to your needs +# Remember to rebuild the container after editing this file \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index bc06b9f9..e0b77e44 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -38,12 +38,11 @@ // Use 'forwardPorts' to make a list of ports inside the container available locally. "forwardPorts": [3000, 27017], - "runArgs": ["--name", "wf.emulator"] - + "runArgs": ["--name", "wf.emulator"], // Use 'postCreateCommand' to run commands after the container is created. // "postCreateCommand": "yarn install", // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" + "remoteUser": "root" } diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index bcdfa433..1f01385d 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -18,6 +18,15 @@ services: # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function. network_mode: service:wf.database + environment: + MONGODB_USERNAME: ${MONDODB_USERNAME} + MONGODB_PASSWORD: ${MONDODB_PASSWORD} + MONGODB_DATABASE: ${MONDODB_DATABASE} + MONGODB_PORT: ${MONGODB_PORT} + MONGODB_URL: ${MONGODB_URL} + LOG_LEVEL: ${LOG_LEVEL} + LOG_FILES: ${LOG_FILES} + # Use "forwardPorts" in **devcontainer.json** to forward an app port locally. # (Adding the "ports" property to this file will not forward from a Codespace.) @@ -29,10 +38,11 @@ services: - mongodb-data:/data/db # Uncomment to change startup options - # environment: - # MONGO_INITDB_ROOT_USERNAME: root - # MONGO_INITDB_ROOT_PASSWORD: example - # MONGO_INITDB_DATABASE: your-database-here + environment: + MONGO_INITDB_ROOT_USERNAME: ${MONGODB_USERNAME} + MONGO_INITDB_ROOT_PASSWORD: ${MONGODB_PASSWORD} + MONGO_INITDB_DATABASE: ${MONGODB_DATABASE} + MONGO_INITDB_PORT: ${MONGODB_PORT} # Add "forwardPorts": ["27017"] to **devcontainer.json** to forward MongoDB locally. # (Adding the "ports" property to this file will not forward from a Codespace.)