This guide will walk you through the process of building a docker image with the new Html Architect from source code and running it on your local machine for development and testing purposes. The Html Architect is work in progress and very few features have been implemented.
Prerequisites
- Docker installed on your system
- Visual Studio (for building the backend)
- Node.js and Yarn (for building the frontend)
- Git (for cloning the repository)
Steps
- Clone Repository
- Build Architect Server and Client Application
- Build the Docker Image
- Create Environment File
- Run Docker Container
1. Clone Repository
First, clone the ORIGAM repository from GitHub:
git clone https://github.com/origam/origam.git
2. Build Architect Server and Client Application
For the backend:
- Open the backend solution
origam\backend\Origam.sln
in Visual Studio. - Set the solution configuration to
Release Architect Server
. - Build the solution.
For the frontend:
- Open a command prompt and navigate to
origam\architect-html
. - Run the following commands:
yarn install
yarn build
3. Build the Docker Image
Now we’ll prepare the files and build the custom Docker image:
- Create the directory
origam\docker\architect\bin
. - Copy the contents of
origam\backend\Origam.Architect.Server\bin\Release\net8.0
toorigam\docker\architect\bin
. - Delete the
logs
directory fromorigam\docker\architect\bin
to avoid a conflict with Docker. - Create a new directory
origam\docker\architect\bin\ClientApplication
. - Copy the contents of
origam\architect-html\dist
toorigam\docker\architect\bin\ClientApplication
. - Open a command prompt, navigate to
origam\docker
, and run:
docker build -t origam_architect_local:1.0 -f DockerfileArchitect.linux .
This creates a custom Docker image named origam_architect_local
with version 1.0.
4. Create Environment File
Create a new file named demo.env
in your working directory (C:\test\docker
) with the following content:
OrigamSettings__DefaultSchemaExtensionId={main package id}
OrigamSettings__DatabaseHost={ip address of your db}
OrigamSettings__DatabasePort=1433
OrigamSettings__DatabaseUsername={your db user}
OrigamSettings__DatabasePassword={your db password}
OrigamSettings__DatabaseName={your db name}
OrigamSettings__Name=Demo
DatabaseType=mssql
TZ=Europe/Prague
Then replace the placeholders
-
{main package id}
: ID of your project’s main package. I you use the test model, the id is:f17329d6-3143-420a-a2e6-30e431eea51d
-
{ip address of your db}
: Your database’s IP address. For a local database, usehost.docker.internal
-
{your db name}
: Name of your new database (preferably your project’s name) -
{your db user}
: Your database username -
{your db password}
: Your database password
Do not change the value of the OrigamSettings__Name
variable. It must be Demo for now. This limi9tation will be removed once the model selection is implemented in the Architect.
Additional configuration
- Create a new database with the name you specified in
{your db name}
- Adjust the time zone if needed by changing
TZ=Europe/Prague
5. Run Docker Container
Now you can run the Docker image with this command (adjust paths as necessary):
docker run --env-file "C:\test\docker\architect\architect_Linux.env" ^
-it --name localArchitect ^
-v {path to the model}:/home/origam/projectData/model ^
-p 8081:8081 ^
origam_architect_local:1.0
Replace the placeholders
{path to the model}
: Path to the model directory of your project. If you use the test model and you cloned it here for example:C:\Repos\origam
the the model path would beC:\Repos\origam\model-tests\model
This command does the following:
- Uses the environment file we created
- Names the container "localArchitect "
- Maps port 8081 from the container to your host machine
- Creates and starts a new Docker container with that image
Accessing the Application
After running the Docker command, wait for the container to start up. Once it’s ready, you can access the custom ORIGAM application by opening http://localhost:8081
in your web browser.
Troubleshooting
- If you encounter build errors, ensure all prerequisites are correctly installed and your development environment is properly set up.
- Double-check all file paths when copying files and running Docker commands.