# See Image Variants at https://hub.docker.com/_/python for information about different flavors of Python containers.
FROM python:3.12-windowsservercore-ltsc2022

COPY ./install ./install

RUN msiexec /i install\FlexSim_24.2.0_x64.msi /quiet /passive /norestart INSTALLDIR=C:\FlexSim

# Copy server files
COPY ./server ./server

ENV FLEXSIM_PATH="C:\FlexSim\program\flexsim.exe"

# NOTE: You must start the container with either
# - LM_PROJECT env variable defined and flexsim_server.lic properly configured, OR
# - FLEXSIM_EVAL_LICENSE env variable set to True (to skip the license check)
# Some defaults are defined here, but they can be overwritten with the -e switch in docker run
ENV FLEXSIM_EVAL_LICENSE="True"
ENV FLEXSIM_SERVER_PORT="8000"

# Run the server as a startup service
CMD [ "python", "server\\server.py" ]