Sign inSign up

advantys/workflowgen-sql-express

By advantys

Updated over 6 years ago

WorkflowGen database ready to use. Development and testing only.

Image
0

3.7K

advantys/workflowgen-sql-express repository overview

WorkflowGen SQL database Docker

This image contains an already configured WorkflowGen database.

Note: This image is intended for testing and development purposes. Using it in production is not supported.

Overview

This WorkflowGen Database image is using Microsoft SQL Server Express for the ltsc2016 version and advantys/mssql-server-windows-express for the ltsc2019 version. This is because Microsoft hasn't released the ltsc2019 version for the SQL Server image on Windows containers yet.

Requirements

  1. If you are using Windows 10, make sure you have at least the Pro version and that you have installed Hyper-V. Then, install Docker for Windows and switch to Windows Containers.
    • Note: You can use any WorkfowGen Database image version with Hyper-V.
  2. If you are using a version of Windows Server 2016 or beyond, follow these instructions to install Docker Enterprise Edition.
  3. You must use the exact Windows Server version associated with the image version.

Run the container

Quick Setup

docker container run -it `
    --env-file .\database.env `
    -v C:\path\wfgen\sql:C:\wfgen\sql `
    --name wfgen_sql `
    advantys/workflowgen-sql-express:7.16.0-win-ltsc2019

Configuration

Keep in mind that any environment variable from the parent image is kept in this image. Consult the microsoft/sql-server-windows-express repository for more details.

Secrets Management

To provide support for secrets management tools such as Docker Secrets and Kubernetes Secrets, any environment variable can be suffixed with _FILE. Its value will then be a path to a file which contains the real value of the configuration. The following example shows the mechanism with Docker Secrets in the Docker Swarm orchestrator.

Note: Environment variables that are not suffixed with _FILE and those who are suffixed with _FILE are mutually exclusive. For example, if you define WFGEN_DATABASE_USER_PASSWORD and WFGEN_DATABASE_USER_PASSWORD_FILE, an error will be thrown and your container will fail to run.

For example, you want to further protect the value of WFGEN_DATABASE_USER_PASSWORD which is yourStrong(!)Password. You will have to first register it into the swarm cluster like this:

docker secret create WFGEN_DATABASE_USER_PASSWORD "yourStrong(!)Password"

Docker Swarm should now have returned to you an id corresponding to the secret. You don't need to memorize it, you won't need it. Repeat the process for the sa account password (SA_PASSWORD) All you need to do now is to run WorkflowGen's database container and link the secret to it:

# Create a volume and move your licence into it.
docker volume create sql

# Create WorkflowGen's service in the cluster
docker service create `
    --env WFGEN_DATABASE_USER_PASSWORD_FILE=C:\ProgramData\Docker\secrets\WFGEN_DATABASE_USER_PASSWORD `
    --env SA_PASSWORD_FILE=C:\ProgramData\Docker\secrets\SA_PASSWORD `
    --env ACCEPT_EULA=Y `
    --secret WFGEN_DATABASE_USER_PASSWORD `
    -v "sql:C:\wfgen\sql" `
    advantys/workflowgen-sql-express:7.16.0-win-ltsc2019

This way, sensitive information is prevented from being exposed from environment variables into the container and are instead written into a file when the container is running and removed when it is not.

WorkflowGen Environment Variables

Some special environment variables are available for specific behaviour. Below is a table explaining each one of them.

VariableDescription
WFGEN_DATABASE_NAMEThe name of the WorkflowGen database. Default: WFGEN
WFGEN_DATABASE_CONTAINMENTSet the WorkflowGen database to contain database users for more portability. Possible values: Y or N. Default: Y
WFGEN_DATABASE_USER_USERNAMEThe username of the database user that has access to the WorkflowGen database. Default: WFGEN_USER
WFGEN_DATABASE_USER_PASSWORDThe password of the database user that has access to the WorkflowGen database.
WFGEN_DATABASE_FILE_PATHInternal path to the database files (.mdf and .ldf) inside the container. Default: C:\wfgen\sql
WFGEN_ADMIN_USERNAMEThe username of WorkflowGen's administrative user. Default: wfgen_admin
WFGEN_ADMIN_PASSWORDThe password of WorkflowGen's administrative user.
WFGEN_AUTH_APPLICATIONIndicates if the authentication method of WorkflowGen is applicative or not. Possible values: Y or N. Default: Y
Example Configuration Using Environment File

When you have multiple environment variables to pass to the container, Docker have a handy parameter called --env-file that you can pass with docker run. This file can contain all of you specific environement variables values. Here is an example:

ACCEPT_EULA=Y
SA_PASSWORD=yourStrong(!)Password
WFGEN_DATABASE_CONTAINMENT=Y
WFGEN_DATABASE_USER_USERNAME=wfgen_user
WFGEN_DATABASE_USER_PASSWORD=myStrong(?)Password
WFGEN_ADMIN_USERNAME=wfgen_admin
WFGEN_ADMIN_PASSWORD=mySuperPassword
WFGEN_AUTH_MODE=application

Volumes

This image exposes three volumes to help persist data from the application.

Container PathDescription
C:\wfgen\sqlThis path contains all the data of the WorflowGen database. (WFGEN.mdf and WFGEN_Log.ldf)

To use an exposed volume:

docker run "..." -v C:\Path\To\sql:C:\wfgen\sql "..." advantys/workflowgen-sql-express:7.16.0-win-ltsc2019

Note: It is recommended to map all the exposed volumes in order to persist each piece of data of WorkflowGen. If one mapping is missing, when you remove the container (docker rm ...), you will lose the associated data.

Alternatively, you can create named volumes in Docker to facilitate the management of your persisted data.

Example:

docker volume create sql

Accessing the container via Powershell

  1. Use the command docker container run -d --env-file database.env --name wfgen_sql advantys/workflowgen-sql-express:7.16.0-win-ltsc2019 to run the image.
  2. Use the command docker container ls to list all your currently running containers. There should only be one at this point.
  3. You can enter a running container by executing docker container exec -it wfgen powershell.
  4. Use the command docker container exec -i wfgen powershell -Command [YOUR COMMAND] to execute a command in the container.
  5. For running a single command in a sporadic container you can also to the following: docker container run --rm -i --env-file database.env advantys/workflowgen:7.16.0-win-ltsc2019 ping 8.8.8.8

Note: When stopping and then starting again this container, any environment variable that you have specified at run will be re-applied.

Note: Data created in the container are not lost when stopping it. They are however lost when you delete the container.

Accessing SQL Server with an external tool

If you want to access the database using an external tool such as SQL Server Management Studio, you can expose the port 1433 to the host and then connect to SQL using the hostname localhost and the 1433 port.

Example command:

docker container run -d -p 1433:1433 --env-file database.env --name wfgen_sql advantys/workflowgen-sql-express:7.16.0-win-ltsc2019

Tag summary

Content type

Image

Digest

Size

2.5 GB

Last updated

over 6 years ago

docker pull advantys/workflowgen-sql-express