Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copy this file to ".env" and set your own values before running docker compose.
# docker compose automatically reads the ".env" file in this directory and
# substitutes these values into docker-compose.yml. The ".env" file is
# git-ignored so real credentials are never committed to the repository.

# PostgreSQL database credentials (used by the "db", "ua-cloudlibrary" and "pgadmin" services)
POSTGRESQL_USERNAME=uacloudlib
POSTGRESQL_PASSWORD=uacloudlib
POSTGRESQL_DATABASE=uacloudlib

# Password for the built-in UA Cloud Library admin ("service") account
SERVICE_PASSWORD=uacloudlib

# pgAdmin login credentials
PGADMIN_DEFAULT_EMAIL=no-reply@opcfoundation.org
PGADMIN_DEFAULT_PASSWORD=uacloudlib
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -358,3 +358,6 @@ launchSettings.json

/UACloudLibraryServer/key-*.xml
/UACloudLibraryServer/pki

# Local docker compose environment file with credentials (never commit)
.env
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,12 @@ For complete documentation and examples, see the [Client Library README](Opc.Ua.

## Development Setup

Start development in three simple steps:
Start development in a few simple steps:

1. Checkout ``git clone https://github.com/OPCFoundation/UA-CloudLibrary.git``
2. Open with Visual Studio 2019+
3. Select ``docker-compose`` as startup project and hit F5 or the "play button"
2. Copy ``.env.example`` to ``.env`` and set your own credentials. ``docker compose`` reads this file and injects the values into ``docker-compose.yml``. The ``.env`` file is git-ignored so credentials are never committed.
3. Open with Visual Studio 2019+
4. Select ``docker-compose`` as startup project and hit F5 or the "play button"

The OPC UA CloudLib Website opens in the browser.

Expand Down
16 changes: 8 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ services:
uanet:
ipv4_address: 10.6.0.20
environment:
ConnectionStrings__CloudLibraryPostgreSQL: "Server=db;Username=uacloudlib;Password=uacloudlib;Database=uacloudlib;Port=5432;Ssl Mode=Prefer"
ServicePassword: uacloudlib
ConnectionStrings__CloudLibraryPostgreSQL: "Server=db;Username=${POSTGRESQL_USERNAME};Password=${POSTGRESQL_PASSWORD};Database=${POSTGRESQL_DATABASE};Port=5432;Ssl Mode=Prefer"
ServicePassword: ${SERVICE_PASSWORD}
PostgreSQLEndpoint: db
APIKeyAuth: "true"
db:
Expand All @@ -25,9 +25,9 @@ services:
uanet:
ipv4_address: 10.6.0.21
environment:
POSTGRES_PASSWORD: uacloudlib
POSTGRES_USER: uacloudlib
POSTGRES_DB: uacloudlib
POSTGRES_PASSWORD: ${POSTGRESQL_PASSWORD}
POSTGRES_USER: ${POSTGRESQL_USERNAME}
POSTGRES_DB: ${POSTGRESQL_DATABASE}
pgadmin:
image: "dpage/pgadmin4"
container_name: pgadmin
Expand All @@ -37,16 +37,16 @@ services:
uanet:
ipv4_address: 10.6.0.22
environment:
PGADMIN_DEFAULT_EMAIL: no-reply@opcfoundation.org
PGADMIN_DEFAULT_PASSWORD: uacloudlib
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
PGADMIN_CONFIG_SERVER_MODE: "False"
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: "False"
volumes:
- ./local-dev-docker/docker_pgadmin_servers.json:/pgadmin4/servers.json
entrypoint:
- "/bin/sh"
- "-c"
- "/bin/echo 'db:5432:*:uacloudlib:uacloudlib' > /tmp/pgpassfile && chmod 600 /tmp/pgpassfile && /entrypoint.sh"
- "/bin/echo 'db:5432:*:${POSTGRESQL_USERNAME}:${POSTGRESQL_PASSWORD}' > /tmp/pgpassfile && chmod 600 /tmp/pgpassfile && /entrypoint.sh"
restart: unless-stopped

networks:
Expand Down
Loading