Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
395c70b
Tag all created docker images with `dev` tag so these can be easily t…
ramonsmits Sep 1, 2023
f08cb64
Ignoring generated docker files
ramonsmits Sep 1, 2023
c9d4235
🐛 docker build was using git ROOT folder, causing all files to be pus…
ramonsmits Sep 4, 2023
3fb11b7
✨ Docker compose sample with init containers
ramonsmits Sep 1, 2023
be0cf1a
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore…
ramonsmits Sep 5, 2023
507e611
Circumvent reposync
ramonsmits Sep 6, 2023
cc945b3
Fix EOF
ramonsmits Sep 6, 2023
253840f
Docker compose for RabbitMQ
ramonsmits Sep 6, 2023
60b18e2
Moved docker compose for servicecontrol instance to subfolder
ramonsmits Sep 6, 2023
8063f7d
Moved folder from sample to docker-sample
ramonsmits Sep 6, 2023
aa71e62
Removed comments from docker compose files and
ramonsmits Sep 6, 2023
21b3045
Made script not rely on C:\
ramonsmits Sep 6, 2023
deaaee0
Removed IP's that should not be in there :-)
ramonsmits Sep 7, 2023
22691a8
Update Docker images directory readme
DavidBoike Sep 7, 2023
19c17ed
Apply suggestions from code review
ramonsmits Sep 7, 2023
a80c233
Generating docker files to project output path and picking artifacts …
ramonsmits Sep 11, 2023
46fd429
Optimize preparing by only copying content of transport folder once t…
ramonsmits Sep 11, 2023
c2014f7
Improved the names of the item groups
ramonsmits Sep 11, 2023
928b5c3
Delete deploy/.dockerignore
ramonsmits Sep 11, 2023
1cc64cf
README for the docker sampe to test the (rabbitmq) images
ramonsmits Sep 11, 2023
287cf57
Apply suggestions from code review
ramonsmits Sep 12, 2023
37221f7
Update src/ServiceControl.DockerImages/ServiceControl.DockerImages.cs…
ramonsmits Sep 12, 2023
67263e0
Extracted building docker folder into a new `PrepareDockerBuildConten…
ramonsmits Sep 12, 2023
0ca696b
⚜️Added comment explaining why the propertygroup cannot be underneath…
ramonsmits Sep 12, 2023
0a59b67
🔨 Moved declaration of `DockerfilesFolder` to `CleanGeneratedDockerfi…
ramonsmits Sep 12, 2023
395cf83
Revert "Generating docker files to project output path and picking ar…
ramonsmits Sep 13, 2023
908b068
whitespace
ramonsmits Sep 13, 2023
e1e9718
Build docker images during CI (for now to measure the duration)
ramonsmits Sep 13, 2023
92d98d5
Revert building docker images as we don't have any supported docker i…
ramonsmits Sep 14, 2023
66d6eff
Refned README
ramonsmits Sep 19, 2023
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
4 changes: 4 additions & 0 deletions dockerfiles/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Dockerfiles dynamically created here by templates
# Can't be in RepoStandards gitignore because other repos may need source-controlled static dockerfiles
*.dockerfile

19 changes: 19 additions & 0 deletions docs/docker-sample/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# ServiceControl on Docker

The sample allows to (partially) test the SC docker images locally.

## Issues

### host.docker.internal not working

The `.env` file contains a `CONNECTIONSTRING` item with the value `host.docker.internal`. This value does not seem to work that needs to be set to the IP address of the host. the

### Host cannot be accessed

Disable the Windows Firewall if the Windows container cannot access the Linux container

## Setup

1. Run the `setup.bat` scripts `rabbitmq` folder to setup a local rabbitmq Linux container
1. Run the `setup.bat` scripts `servicecontrol` folder to setup a servicecontrol primary, audit and monitoring instance in 3 Windows container using the RabbitMQ transport

17 changes: 17 additions & 0 deletions docs/docker-sample/rabbitmq/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3'

services:

rabbitmq:
image: rabbitmq:3-management
platform: linux
hostname: rabbitmq
ports:
- 5672:5672
- 15672:15672
volumes:
- rabbitmq-data:/var/lib/rabbitmq/mnesia
- ./enabled_plugins:/etc/rabbitmq/enabled_plugins

volumes:
rabbitmq-data:
1 change: 1 addition & 0 deletions docs/docker-sample/rabbitmq/enabled_plugins
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[rabbitmq_federation_management,rabbitmq_management,rabbitmq_mqtt,rabbitmq_stomp,rabbitmq_shovel,rabbitmq_shovel_management].
2 changes: 2 additions & 0 deletions docs/docker-sample/rabbitmq/setup.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"%ProgramFiles%\Docker\Docker\DockerCli.exe" -SwitchLinuxEngine
docker compose up -d
10 changes: 10 additions & 0 deletions docs/docker-sample/servicecontrol/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ServiceControl_DatabaseMaintenancePort = 44444
ServiceControl_RemoteInstances = [{'api_uri':'http://scaudit:44444/api'}]
ServiceControl_Audit_ServiceControlQueueAddress = Particular.ServiceControl

# Often host.docker.internal does not work on Windows containers. Replace with the actual IP of the docker host and also check firewall
CONNECTIONSTRING=host=host.docker.internal

ServiceControl_ConnectionString=%CONNECTIONSTRING%
ServiceControl_Audit_ConnectionString=%CONNECTIONSTRING%
Monitoring_ConnectionString=%CONNECTIONSTRING%
80 changes: 80 additions & 0 deletions docs/docker-sample/servicecontrol/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
version: '3.8'

services:

primary-init:
image: particular/servicecontrol.rabbitmq.quorum.conventional.init-windows:dev
platform: windows
hostname: scprimary
ports:
- 33333:33333
volumes:
- primary-db:c:/data/
- c:/ProgramData/ParticularSoftware/:c:/ProgramData/ParticularSoftware/:ro
env_file: .env

audit-init:
image: particular/servicecontrol.rabbitmq.quorum.conventional.audit.init-windows:dev
platform: windows
hostname: scaudit
ports:
- 44444:44444
volumes:
- audit-db:c:/data/
- c:/ProgramData/ParticularSoftware/:c:/ProgramData/ParticularSoftware/:ro
env_file: .env

monitoring-init:
image: particular/servicecontrol.rabbitmq.quorum.conventional.monitoring.init-windows:dev
platform: windows
hostname: scmonitoring
ports:
- 33633:33633
volumes:
- c:/ProgramData/ParticularSoftware/:c:/ProgramData/ParticularSoftware/:ro
env_file: .env

primary:
depends_on:
primary-init:
condition: service_completed_successfully
image: particular/servicecontrol.rabbitmq.quorum.conventional-windows:dev
platform: windows
hostname: scprimary
ports:
- 33333:33333
volumes:
- primary-db:c:/data/
- c:/ProgramData/ParticularSoftware/:c:/ProgramData/ParticularSoftware/:ro
env_file: .env

audit:
depends_on:
audit-init:
condition: service_completed_successfully
image: particular/servicecontrol.rabbitmq.quorum.conventional.audit-windows:dev
platform: windows
hostname: scaudit
ports:
- 44444:44444
volumes:
- audit-db:c:/data/
- c:/ProgramData/ParticularSoftware/:c:/ProgramData/ParticularSoftware/:ro
env_file: .env

monitoring:
depends_on:
monitoring-init:
condition: service_completed_successfully
image: particular/servicecontrol.rabbitmq.quorum.conventional.monitoring-windows:dev
platform: windows
hostname: scmon
ports:
- 33633:33633
volumes:
- c:/ProgramData/ParticularSoftware/:c:/ProgramData/ParticularSoftware/:ro
env_file: .env

volumes:
primary-db:
audit-db:
2 changes: 2 additions & 0 deletions docs/docker-sample/servicecontrol/setup.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"%ProgramFiles%\Docker\Docker\DockerCli.exe" -SwitchWindowsEngine
docker compose up -d
17 changes: 9 additions & 8 deletions src/ServiceControl.DockerImages/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
 # ServiceControl.DockerImages


WARNING

This project is not automatically built when building the solution
to keep the overall build time under control.
To build Docker images explicitly build this project.
# ServiceControl.DockerImages

WARNING: This project is not automatically built when building the solution to keep the overall build time under control.

To build Docker images explicitly build this project.

## Notes

* Each `ADD`, `ENV` or `EXPOSE` statement creates an additional layer in the Docker container, so these statements should be combined into one and not split out.
43 changes: 36 additions & 7 deletions src/ServiceControl.DockerImages/ServiceControl.DockerImages.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
</ItemGroup>

<PropertyGroup>
<!-- Location used by release CI to push each docker image to docker hub -->
<DockerfilesFolder>..\..\dockerfiles\</DockerfilesFolder>
</PropertyGroup>

Expand Down Expand Up @@ -90,20 +91,48 @@
<!-- monitoring instance and sidecar dockerfiles -->
<Copy SourceFiles="servicecontrol.transport.monitoring.init-windows.dockerfile-template" DestinationFiles="$(DockerfilesFolder)servicecontrol.%(SupportedTransport.DockerfileCustomization).monitoring.init-windows.dockerfile" />
<Copy SourceFiles="servicecontrol.transport.monitoring-windows.dockerfile-template" DestinationFiles="$(DockerfilesFolder)servicecontrol.%(SupportedTransport.DockerfileCustomization).monitoring-windows.dockerfile" />

</Target>

<Target Name="PrepareDockerBuildContent" AfterTargets="ExpandDockerfileTemplates">

<ItemGroup>
<DeployErrorFiles Include="..\..\deploy\Particular.ServiceControl\**\*.*" Exclude="**\Transports\**" />
<DeployAuditFiles Include="..\..\deploy\Particular.ServiceControl.Audit\**\*.*" Exclude="**\Transports\**" />
<DeployMonitoringFiles Include="..\..\deploy\Particular.ServiceControl.Monitoring\**\*.*" Exclude="**\Transports\**" />
<DeployTransportFiles Include="..\..\deploy\Particular.ServiceControl.Monitoring\Transports\**\*.*" />
</ItemGroup>

<Copy SourceFiles="@(DeployErrorFiles)" DestinationFolder="$(OutputPath)\docker\Particular.ServiceControl\%(RecursiveDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(DeployAuditFiles)" DestinationFolder="$(OutputPath)\docker\Particular.ServiceControl.Audit\%(RecursiveDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(DeployMonitoringFiles)" DestinationFolder="$(OutputPath)\docker\Particular.ServiceControl.Monitoring\%(RecursiveDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(DeployTransportFiles)" DestinationFolder="$(OutputPath)\docker\Transports\%(RecursiveDir)" SkipUnchangedFiles="true" />

</Target>

<Target Name="BuildDockerImages" AfterTargets="ExpandDockerfileTemplates">
<Target Name="BuildDockerImages" AfterTargets="PrepareDockerBuildContent">
<!-- Build primary instance and sidecar images -->
<Exec Command="docker build -f $(DockerfilesFolder)servicecontrol.%(SupportedTransport.DockerfileCustomization).init-windows.dockerfile -t particular/servicecontrol.%(SupportedTransport.DockerfileCustomization).init-windows:$(MinVerVersion) --build-arg TRANSPORT=%(SupportedTransport.TransportName) --build-arg TRANSPORT_CUSTOMIZATION_TYPE=%(SupportedTransport.TransportCustomizationType) ./../../" />
<Exec Command="docker build -f $(DockerfilesFolder)servicecontrol.%(SupportedTransport.DockerfileCustomization)-windows.dockerfile -t particular/servicecontrol.%(SupportedTransport.DockerfileCustomization)-windows:$(MinVerVersion) --build-arg TRANSPORT=%(SupportedTransport.TransportName) --build-arg TRANSPORT_CUSTOMIZATION_TYPE=%(SupportedTransport.TransportCustomizationType) ./../../" />
<Exec Command="docker build -f $(DockerfilesFolder)servicecontrol.%(SupportedTransport.DockerfileCustomization).init-windows.dockerfile -t particular/servicecontrol.%(SupportedTransport.DockerfileCustomization).init-windows:$(MinVerVersion) --build-arg TRANSPORT=%(SupportedTransport.TransportName) --build-arg TRANSPORT_CUSTOMIZATION_TYPE=%(SupportedTransport.TransportCustomizationType) $(OutputPath)/docker" />
<Exec Command="docker build -f $(DockerfilesFolder)servicecontrol.%(SupportedTransport.DockerfileCustomization)-windows.dockerfile -t particular/servicecontrol.%(SupportedTransport.DockerfileCustomization)-windows:$(MinVerVersion) --build-arg TRANSPORT=%(SupportedTransport.TransportName) --build-arg TRANSPORT_CUSTOMIZATION_TYPE=%(SupportedTransport.TransportCustomizationType) $(OutputPath)/docker" />

<!-- Build audit instance and sidecar images -->
<Exec Command="docker build -f $(DockerfilesFolder)servicecontrol.%(SupportedTransport.DockerfileCustomization).audit.init-windows.dockerfile -t particular/servicecontrol.%(SupportedTransport.DockerfileCustomization).audit.init-windows:$(MinVerVersion) --build-arg TRANSPORT=%(SupportedTransport.TransportName) --build-arg TRANSPORT_CUSTOMIZATION_TYPE=%(SupportedTransport.TransportCustomizationType) ./../../" />
<Exec Command="docker build -f $(DockerfilesFolder)servicecontrol.%(SupportedTransport.DockerfileCustomization).audit-windows.dockerfile -t particular/servicecontrol.%(SupportedTransport.DockerfileCustomization).audit-windows:$(MinVerVersion) --build-arg TRANSPORT=%(SupportedTransport.TransportName) --build-arg TRANSPORT_CUSTOMIZATION_TYPE=%(SupportedTransport.TransportCustomizationType) ./../../" />
<Exec Command="docker build -f $(DockerfilesFolder)servicecontrol.%(SupportedTransport.DockerfileCustomization).audit.init-windows.dockerfile -t particular/servicecontrol.%(SupportedTransport.DockerfileCustomization).audit.init-windows:$(MinVerVersion) --build-arg TRANSPORT=%(SupportedTransport.TransportName) --build-arg TRANSPORT_CUSTOMIZATION_TYPE=%(SupportedTransport.TransportCustomizationType) $(OutputPath)/docker" />
<Exec Command="docker build -f $(DockerfilesFolder)servicecontrol.%(SupportedTransport.DockerfileCustomization).audit-windows.dockerfile -t particular/servicecontrol.%(SupportedTransport.DockerfileCustomization).audit-windows:$(MinVerVersion) --build-arg TRANSPORT=%(SupportedTransport.TransportName) --build-arg TRANSPORT_CUSTOMIZATION_TYPE=%(SupportedTransport.TransportCustomizationType) $(OutputPath)/docker" />

<!-- Build monitoring instance and sidecar images -->
<Exec Command="docker build -f $(DockerfilesFolder)servicecontrol.%(SupportedTransport.DockerfileCustomization).monitoring.init-windows.dockerfile -t particular/servicecontrol.%(SupportedTransport.DockerfileCustomization).monitoring.init-windows:$(MinVerVersion) --build-arg TRANSPORT=%(SupportedTransport.TransportName) --build-arg TRANSPORT_CUSTOMIZATION_TYPE=%(SupportedTransport.TransportCustomizationType) ./../../" />
<Exec Command="docker build -f $(DockerfilesFolder)servicecontrol.%(SupportedTransport.DockerfileCustomization).monitoring-windows.dockerfile -t particular/servicecontrol.%(SupportedTransport.DockerfileCustomization).monitoring-windows:$(MinVerVersion) --build-arg TRANSPORT=%(SupportedTransport.TransportName) --build-arg TRANSPORT_CUSTOMIZATION_TYPE=%(SupportedTransport.TransportCustomizationType) ./../../" />
<Exec Command="docker build -f $(DockerfilesFolder)servicecontrol.%(SupportedTransport.DockerfileCustomization).monitoring.init-windows.dockerfile -t particular/servicecontrol.%(SupportedTransport.DockerfileCustomization).monitoring.init-windows:$(MinVerVersion) --build-arg TRANSPORT=%(SupportedTransport.TransportName) --build-arg TRANSPORT_CUSTOMIZATION_TYPE=%(SupportedTransport.TransportCustomizationType) $(OutputPath)/docker" />
<Exec Command="docker build -f $(DockerfilesFolder)servicecontrol.%(SupportedTransport.DockerfileCustomization).monitoring-windows.dockerfile -t particular/servicecontrol.%(SupportedTransport.DockerfileCustomization).monitoring-windows:$(MinVerVersion) --build-arg TRANSPORT=%(SupportedTransport.TransportName) --build-arg TRANSPORT_CUSTOMIZATION_TYPE=%(SupportedTransport.TransportCustomizationType) $(OutputPath)/docker" />

<!-- Tag as "dev" for easier local testing of containers -->

<Exec Command="docker tag particular/servicecontrol.%(SupportedTransport.DockerfileCustomization).init-windows:$(MinVerVersion) particular/servicecontrol.%(SupportedTransport.DockerfileCustomization).init-windows:dev" />
<Exec Command="docker tag particular/servicecontrol.%(SupportedTransport.DockerfileCustomization)-windows:$(MinVerVersion) particular/servicecontrol.%(SupportedTransport.DockerfileCustomization)-windows:dev" />

<Exec Command="docker tag particular/servicecontrol.%(SupportedTransport.DockerfileCustomization).audit.init-windows:$(MinVerVersion) particular/servicecontrol.%(SupportedTransport.DockerfileCustomization).audit.init-windows:dev" />
<Exec Command="docker tag particular/servicecontrol.%(SupportedTransport.DockerfileCustomization).audit-windows:$(MinVerVersion) particular/servicecontrol.%(SupportedTransport.DockerfileCustomization).audit-windows:dev" />

<Exec Command="docker tag particular/servicecontrol.%(SupportedTransport.DockerfileCustomization).monitoring.init-windows:$(MinVerVersion) particular/servicecontrol.%(SupportedTransport.DockerfileCustomization).monitoring.init-windows:dev" />
<Exec Command="docker tag particular/servicecontrol.%(SupportedTransport.DockerfileCustomization).monitoring-windows:$(MinVerVersion) particular/servicecontrol.%(SupportedTransport.DockerfileCustomization).monitoring-windows:dev" />
</Target>

</Project>
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
FROM mcr.microsoft.com/dotnet/framework/runtime:4.7.2-windowsservercore-ltsc2016
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2022

WORKDIR /servicecontrol

ARG TRANSPORT
ADD /deploy/Particular.ServiceControl/ServiceControl .
ADD /deploy/Particular.ServiceControl/Transports/${TRANSPORT} .
ADD /deploy/Particular.ServiceControl/Persisters/RavenDB35 .

ENV "SERVICECONTROL_RUNNING_IN_DOCKER"="true"
ADD /Particular.ServiceControl/ServiceControl /Transports/${TRANSPORT} /Particular.ServiceControl/Persisters/RavenDB35 ./

ARG TRANSPORT_CUSTOMIZATION_TYPE
ENV "ServiceControl/TransportType"="${TRANSPORT_CUSTOMIZATION_TYPE}"
ENV "ServiceControl/PersistenceType"="ServiceControl.Persistence.RavenDb.RavenDbPersistenceConfiguration, ServiceControl.Persistence.RavenDb"
ENV "ServiceControl/Hostname"="*"

ENV "ServiceControl/DBPath"="C:\\Data\\DB\\"
ENV "ServiceControl/LogPath"="C:\\Data\\Logs\\"

# Defaults
ENV "ServiceControl/ForwardErrorMessages"="False"
ENV "ServiceControl/ErrorRetentionPeriod"="15"

EXPOSE 33333
EXPOSE 33334
ENV "ServiceControl/TransportType"="${TRANSPORT_CUSTOMIZATION_TYPE}" \
"ServiceControl/PersistenceType"="ServiceControl.Persistence.RavenDb.RavenDbPersistenceConfiguration, ServiceControl.Persistence.RavenDb" \
"ServiceControl/Hostname"="*" \
"ServiceControl/DBPath"="C:\\Data\\DB\\" \
"ServiceControl/LogPath"="C:\\Data\\Logs\\" \
"ServiceControl/ForwardErrorMessages"="False" \
"ServiceControl/ErrorRetentionPeriod"="15" \
"SERVICECONTROL_RUNNING_IN_DOCKER"="true"

VOLUME [ "C:/Data" ]

EXPOSE 33333 33334

ENTRYPOINT ["ServiceControl.exe", "--portable"]
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
FROM mcr.microsoft.com/dotnet/framework/runtime:4.7.2-windowsservercore-ltsc2016
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2022

WORKDIR /servicecontrol.audit

ARG TRANSPORT
ADD /deploy/Particular.ServiceControl.Audit/ServiceControl.Audit .
ADD /deploy/Particular.ServiceControl.Audit/Transports/${TRANSPORT} .
ADD /deploy/Particular.ServiceControl.Audit/Persisters/RavenDB35 .

ENV "SERVICECONTROL_RUNNING_IN_DOCKER"="true"
ADD /Particular.ServiceControl.Audit/ServiceControl.Audit /Transports/${TRANSPORT} /Particular.ServiceControl.Audit/Persisters/RavenDB35 ./

ARG TRANSPORT_CUSTOMIZATION_TYPE
ENV "ServiceControl.Audit/TransportType"="${TRANSPORT_CUSTOMIZATION_TYPE}"
ENV "ServiceControl.Audit/PersistenceType"="ServiceControl.Audit.Persistence.RavenDb.RavenDbPersistenceConfiguration, ServiceControl.Audit.Persistence.RavenDb"
ENV "ServiceControl.Audit/Hostname"="*"

ENV "ServiceControl.Audit/DBPath"="C:\\Data\\DB\\"
ENV "ServiceControl.Audit/LogPath"="C:\\Data\\Logs\\"

# Defaults
ENV "ServiceControl.Audit/ForwardAuditMessages"="False"
ENV "ServiceControl.Audit/AuditRetentionPeriod"="365"
ENV "ServiceControl.Audit/DatabaseMaintenancePort"="44445"

EXPOSE 44444
EXPOSE 44445
ENV "ServiceControl.Audit/TransportType"="${TRANSPORT_CUSTOMIZATION_TYPE}" \
"ServiceControl.Audit/PersistenceType"="ServiceControl.Audit.Persistence.RavenDb.RavenDbPersistenceConfiguration, ServiceControl.Audit.Persistence.RavenDb" \
"ServiceControl.Audit/Hostname"="*" \
"ServiceControl.Audit/DBPath"="C:\\Data\\DB\\" \
"ServiceControl.Audit/LogPath"="C:\\Data\\Logs\\" \
"ServiceControl.Audit/ForwardAuditMessages"="False" \
"ServiceControl.Audit/AuditRetentionPeriod"="365" \
"ServiceControl.Audit/DatabaseMaintenancePort"="44445" \
"SERVICECONTROL_RUNNING_IN_DOCKER"="true"

VOLUME [ "C:/Data" ]

EXPOSE 44444 44445

ENTRYPOINT ["ServiceControl.Audit.exe", "--portable"]
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
FROM mcr.microsoft.com/dotnet/framework/runtime:4.7.2-windowsservercore-ltsc2016
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2022

WORKDIR /servicecontrol.audit

ARG TRANSPORT
ADD /deploy/Particular.ServiceControl.Audit/ServiceControl.Audit .
ADD /deploy/Particular.ServiceControl.Audit/Transports/${TRANSPORT} .
ADD /deploy/Particular.ServiceControl.Audit/Persisters/RavenDB35 .

ENV "SERVICECONTROL_RUNNING_IN_DOCKER"="true"
ADD /Particular.ServiceControl.Audit/ServiceControl.Audit /Transports/${TRANSPORT} /Particular.ServiceControl.Audit/Persisters/RavenDB35 ./

ARG TRANSPORT_CUSTOMIZATION_TYPE
ENV "ServiceControl.Audit/TransportType"="${TRANSPORT_CUSTOMIZATION_TYPE}"
ENV "ServiceControl.Audit/PersistenceType"="ServiceControl.Audit.Persistence.RavenDb.RavenDbPersistenceConfiguration, ServiceControl.Audit.Persistence.RavenDb"
ENV "ServiceControl.Audit/Hostname"="*"

ENV "ServiceControl.Audit/DBPath"="C:\\Data\\DB\\"
ENV "ServiceControl.Audit/LogPath"="C:\\Data\\Logs\\"

# Defaults
ENV "ServiceControl.Audit/ForwardAuditMessages"="False"
ENV "ServiceControl.Audit/AuditRetentionPeriod"="365"
ENV "ServiceControl.Audit/DatabaseMaintenancePort"="44445"
ENV "ServiceControl.Audit/TransportType"="${TRANSPORT_CUSTOMIZATION_TYPE}" \
"ServiceControl.Audit/PersistenceType"="ServiceControl.Audit.Persistence.RavenDb.RavenDbPersistenceConfiguration, ServiceControl.Audit.Persistence.RavenDb" \
"ServiceControl.Audit/Hostname"="*" \
"ServiceControl.Audit/DBPath"="C:\\Data\\DB\\" \
"ServiceControl.Audit/LogPath"="C:\\Data\\Logs\\" \
"ServiceControl.Audit/ForwardAuditMessages"="False" \
"ServiceControl.Audit/AuditRetentionPeriod"="365" \
"ServiceControl.Audit/DatabaseMaintenancePort"="44445" \
"SERVICECONTROL_RUNNING_IN_DOCKER"="true"

VOLUME [ "C:/Data" ]

Expand Down
Loading