Deploy Creatio .NET Core application server on Linux using Docker
Use this deployment method to run a compartmentalized Creatio application. We assume that you have installed the Redis sever, deployed the Creatio database, and set up the ConnectionStrings.config file using the instructions in the previous steps.
To deploy Creatio application server using Docker:
-
Make Redis accessible from the Docker container. Read more >>>
-
Install Docker. Read more >>>
-
Create a Dockerfile. Read more >>>
-
Build and run Docker image. Read more >>>
Attention
We recommend deploying the application using Docker for development and testing environments only. Please avoid using Docker for the production environment before we implement the support of the application updates in Docker (planned for the upcoming releases).
Configure Creatio caching server (Redis)
1.Open redis.conf in a text editor as root. For example, use the Nano text editor:
sudo nano /etc/redis/redis.conf
2.Locate the “bind 127.0.0.1 ::1” entry. Replace the entry with “bind 0.0.0.0” to listen to all available IPV4 interfaces.
3.Save changes and exit the editor.
4.Restart the Redis server:
sudo systemctl restart redis-server
To install Docker, run:
sudo apt-get install docker
To create a Dockerfile:
1.Navigate to the application directory:
cd /path/to/application/directory/
/path/to/application/directory/ – the directory with Creatio setup files.
2.Create a Dockerfile using a text editor. For example, use the Nano text editor:
nano Dockerfile
3.Insert the following code:
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS base
EXPOSE 5000 5002
RUN apt-get update && \
apt-get -y --no-install-recommends install \
libgdiplus \
libc6-dev && \
apt-get clean all && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/*
WORKDIR /app
COPY . ./
FROM base AS final
WORKDIR /app
ENV ASPNETCORE_ENVIRONMENT Development
ENV TZ US/Eastern
ENTRYPOINT ["dotnet", "Terrasoft.WebHost.dll"]
4.Press Ctrl+O to apply the changes.
5.Save changes and exit the editor.
Build a docker image:
docker build -f Dockerfile -t creatioimg .
Run the docker image:
docker run -p http_port_number:5000 -p https_port_number:5002 -d --dns=DNS_server_ip --dns-search=DNS_address_suffix -v /logspath/mycreatio:/app/Logs --name Creatio creatioimg
http_port_number – a port number. Docker will serve the HTTP version on this port
https_port_number – a port number. Docker will serve the HTTPS version on this port
DNS_server_ip – the IP address of a DNS server to enable the container to resolve Internet domains. You can use multiple --dns flags for multiple DNS servers.
DNS_address_suffix – a DNS search domain to enable the container to search non-fully-qualified hostnames. You can use multiple --dns-search flags for multiple DNS search domains.
Note
Add the --restart=always flag to the command make a persistent Docker container.
The HTTP version of the Creatio application will be available on port http_port_number.
The HTTPS version of the Creatio application will be available on port https_port_number.
Note
To log in to a newly deployed application, use the default Supervisor user account. It is highly recommended to change the Supervisor password immediately. Login: Supervisor; Password: Supervisor.
Previous step
•Setting up the ConnectionStrings.config file
See also
•Deploy Creatio .NET Core application server on Linux directly