FAQ's
How to build and run containers locally?
- Open the terminal
- Set the directory to src
- Build the api
docker build -f api/Fig.Api/Dockerfile -t fig.api .
- Start the api
docker run -p 5000:80 -it fig.api
- Build the web
docker build -f web/Fig.Web/Dockerfile -t fig.web .
- Start the web
docker run -p 8080:80 -e FIG_API_ADDRESS=https://localhost:5000 fig.web
- Open a web browser and navigate to https://localhost:8080
How to export a container image
https://stackoverflow.com/a/46526598
docker export $(docker ps -lq) -o fig.web.tar
Can I run this on an Apple Silicon (M1/M2) Mac?
Yes, the easiest way to run fig is by using containers, these run on Apple silicon as well as any other processor. However, if you want to build the solution on an M1/M2 Mac, follow these steps:
- Clone the code
- Copy
libSQLite.Interop.dll
from theexternal
folder to/usr/local/lib
(it may need to be created) - You should be up and running.
If you want to do everything from scratch, follow the steps below:
Clone the code
From the SQLite download page, download the sql lite source code. At time of writing, this was sqlite-netFx-source-1.0.116.0.zip
Unzip
Open /Setup/compile-interop-assembly-release.sh in a text editor.
Change the architecture from
x86_64
toarm64
(orarm64e
if you are running macOS earlier than Ventura). It should look like thisif [[ "$OSTYPE" == "darwin"* ]]; then
libname=libSQLite.Interop.dylib
# NOTE: No longer works in 10.14+
# gccflags="-arch i386 -arch x86_64"
gccflags="-arch arm64"
else
libname=libSQLite.Interop.so
gccflags=""
fiIn the terminal Execute the following
cd Setup
sh compile-interop-assembly-release.shIt will create this file:
/bin/2013/Release/bin/SQLite.Interop.dll
Create the directory
/usr/local/lib
(if it didn't already exist) and copySQLite.Interop.dll
to that directory.Rename it to
libSQLite.Interop.dll
In the terminal, return to the base directory and build the project using the following command:
dotnet build -c Release SQLite.NET.NetStandard20.sln
Add a reference the file which now has been created at
/bin/NetStandard20/ReleaseNetStandard20/bin/netstandard2.0/System.Data.SQLite.dll
to the Fig.Api project (you can move it first to a more approproiate location)