diff --git a/Dockerfile b/Dockerfile index 1663ab42..40820084 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,13 @@ FROM mcr.microsoft.com/dotnet/runtime:8.0 + VOLUME /config VOLUME /logs VOLUME /certificates + COPY /deploy /extractor + WORKDIR /extractor + COPY /config/config.remote.yml /config_remote/config.yml COPY /config/opc.ua.net.extractor.Config.xml /config_remote @@ -12,4 +16,11 @@ ENV OPCUA_CERTIFICATE_DIR="/certificates" ENV OPCUA_OWN_CERTIFICATE_DIR="/certificates/pki/own" ENV OPCUA_CERTIFICATE_SUBJECT="CN=Opcua-extractor, C=NO, S=Oslo, O=Cognite, DC=docker.opcua" +RUN mkdir -p /logs /certificates +RUN chmod -R a+rw /logs +RUN chmod -R a+rw /certificates + +RUN groupadd -g 1000 extractor && useradd -m -u 1000 -g extractor extractor +USER extractor + ENTRYPOINT ["dotnet", "/extractor/OpcuaExtractor.dll"] diff --git a/Dockerfile.bridge b/Dockerfile.bridge index 42025215..17c73094 100644 --- a/Dockerfile.bridge +++ b/Dockerfile.bridge @@ -6,4 +6,10 @@ WORKDIR /bridge ENV MQTT_BRIDGE_CONFIG_DIR="/config" +RUN mkdir -p /logs +RUN chmod -R a+rw /logs + +RUN groupadd -g 1000 extractor && useradd -m -u 1000 -g extractor extractor +USER extractor + ENTRYPOINT ["dotnet", "/bridge/MQTTCDFBridge.dll"]