Containers now embed environment variables dynamically
This commit is contained in:
parent
680e6ecd02
commit
2c8d2a0a8d
16
.devcontainer/.env
Normal file
16
.devcontainer/.env
Normal file
@ -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
|
@ -38,12 +38,11 @@
|
|||||||
|
|
||||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
"forwardPorts": [3000, 27017],
|
"forwardPorts": [3000, 27017],
|
||||||
"runArgs": ["--name", "wf.emulator"]
|
"runArgs": ["--name", "wf.emulator"],
|
||||||
|
|
||||||
|
|
||||||
// Use 'postCreateCommand' to run commands after the container is created.
|
// Use 'postCreateCommand' to run commands after the container is created.
|
||||||
// "postCreateCommand": "yarn install",
|
// "postCreateCommand": "yarn install",
|
||||||
|
|
||||||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||||
// "remoteUser": "root"
|
"remoteUser": "root"
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,15 @@ services:
|
|||||||
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
|
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
|
||||||
network_mode: service:wf.database
|
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.
|
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
|
||||||
# (Adding the "ports" property to this file will not forward from a Codespace.)
|
# (Adding the "ports" property to this file will not forward from a Codespace.)
|
||||||
|
|
||||||
@ -29,10 +38,11 @@ services:
|
|||||||
- mongodb-data:/data/db
|
- mongodb-data:/data/db
|
||||||
|
|
||||||
# Uncomment to change startup options
|
# Uncomment to change startup options
|
||||||
# environment:
|
environment:
|
||||||
# MONGO_INITDB_ROOT_USERNAME: root
|
MONGO_INITDB_ROOT_USERNAME: ${MONGODB_USERNAME}
|
||||||
# MONGO_INITDB_ROOT_PASSWORD: example
|
MONGO_INITDB_ROOT_PASSWORD: ${MONGODB_PASSWORD}
|
||||||
# MONGO_INITDB_DATABASE: your-database-here
|
MONGO_INITDB_DATABASE: ${MONGODB_DATABASE}
|
||||||
|
MONGO_INITDB_PORT: ${MONGODB_PORT}
|
||||||
|
|
||||||
# Add "forwardPorts": ["27017"] to **devcontainer.json** to forward MongoDB locally.
|
# Add "forwardPorts": ["27017"] to **devcontainer.json** to forward MongoDB locally.
|
||||||
# (Adding the "ports" property to this file will not forward from a Codespace.)
|
# (Adding the "ports" property to this file will not forward from a Codespace.)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user