Instalación y configuración > Uso de ThingWorx Docker > Uso de una base de datos externa de Microsoft SQL Server para Docker de ThingWorx
Uso de una base de datos externa de Microsoft SQL Server para Docker de ThingWorx
En el siguiente ejemplo, se muestra un fichero Compose de Docker para una instancia de Microsoft SQL Server que utiliza una base de datos externa:
version: '2.2'
# Note, this example includes a _blank_ mssql docker image for demonstration
# purposes. The mssql service should be removed and DATABASE_HOST should point
# to the production database either with a DNS name, or IP.
services:
mssql:
image: microsoft/mssql-server-linux:2017-latest
ports:
- "1433"
healthcheck:
test: /opt/mssql-tools/bin/sqlcmd -U SA -P "$${SA_PASSWORD}" -h -1
-Q "set nocount on; select serverproperty('ServerName')" | grep -w "$${HOSTNAME}"
interval: 15s
environment:
# NOTE: You must set SA_PASSWORD manually if using this image for testing.
- "SA_PASSWORD="
- "ACCEPT_EULA=y"
platform:
image: thingworx/platform-mssql:latest
healthcheck:
test: curl -s -w '%{http_code}' -U 'bad:creds'
localhost:8080/Thingworx/Subsystems/PlatformSubsystem | grep -w 401
interval: 15s
ports:
- "8080:8080"
- "8443:8443"
environment:
- "INITIAL_HEAP=2"
- "MAX_HEAP=4"
- "DATABASE_HOST=mssql"
- "DATABASE_PORT=1433"
- "TWX_DATABASE_USERNAME=thingworx"
- "TWX_DATABASE_SCHEMA=thingworx"
# NOTE: TWX_DATABASE_PASSWORD for MSSQL platform must be set to match your
# environment.
- "TWX_DATABASE_PASSWORD="
- "ENABLE_HTTP=true"
- "ENABLE_HTTPS=false"
# NOTE: If supplying a keystore for SSL, you must set your keystore password
#- "SSL_KEYSTORE_PASSWORD="
- "DATABASE_ADMIN_USERNAME=SA"
# NOTE: DATABASE_ADMIN_PASSWORD should match your environment or SA_PASSWORD
# if using the above image for testing.
- "DATABASE_ADMIN_PASSWORD="
volumes:
- "./thingworx-mssql-storage/ThingworxPlatform:/ThingworxPlatform"
- "./thingworx-mssql-storage/ThingworxStorage:/ThingworxStorage"
- "./thingworx-mssql-storage/ThingworxBackupStorage:/ThingworxBackupStorage"
- "./thingworx-mssql-storage/tomcat-logs:/opt/apache-tomcat/logs"
Para obtener información sobre la configuración de la base de datos y el esquema de MS SQL Server en casos externos, consulte Instalación de ThingWorx.