In order to get the project running locally for development here are a few steps:
cd Ghost.Data
dotnet ef database update
or~/.dotnet/tools/dotnet-ef database update
sudo apt-get update && sudo apt-get install -y ffmpeg
cd Ghost.Web
dotnet watch run --urls=http://localhost:5120
docker build -t ghost-media-dev -f Dockerfile.dev .
docker run -d \
-p 5120:5120 \
-v $(pwd):/app \
-v $(pwd)/assets:/media/assets \
-e DATABASE_PATH=/app/data/Ghost.db \
--name ghost-media-dev ghost-media-dev
cd Ghost.Web.React
npm i
npm start
- `cd Ghost.Web
docker build -t ghost-media-react -f Dockerfile .
same as production buildnpm i
docker run -d \
-p 3000:3000 \
-v $(pwd):/app
-e VITE_APP_SERVER_URL=http://192.168.178.27:5120 \
--name ghost-media-react-dev ghost-media-react
This container is used to update the database if there are any migrations that need to be run on the data
-
docker image rm ghost-updater
-
docker build -t ghost-updater -f Ghost.Data/Dockerfile Ghost.Data
docker run --rm \
-v $(pwd)/data:/data \
-e DATABASE_PATH=/data/Ghost.db \
ghost-updater
This container uses the database that we created or updated with the Ghost Data container to run the API
-
docker build -t ghost-media -f Dockerfile .
-
You can mount as many volumes inside of the
media
folder in the container. You will use this folder to setup your media. You can also replace theDATABASE_PATH
with whatever you need as long as it is mounted in the volume.
docker run -d \
-p 8080:80 \
-e DATABASE_PATH=/data/Ghost.db \
-v $(pwd)/assets:/media/assets \
-v $(pwd)/data:/data \
--name ghost-media ghost-media
This container is the frontend container that connects to the API
-
docker build -t ghost-media-react -f Ghost.Web/Dockerfile Ghost.Web
-
You can replace the
VITE_APP_SERVER_URL
with the the IP address of the running server
docker run -d \
-p 3001:3000 \
-e VITE_APP_SERVER_URL=http://localhost:8080 \
--name ghost-media-react ghost-media-react
Currently this project is in MVP state so there is no fancy library path picker. To add a library to your application
- Make sure the folder is mounted
- Go to the
Library
tab and clickAdd Library
- Pick a name and add as many paths of the library as you wish
- Finish by clicking
Create Library
- You will be redirected to the
Library
tab again with your newly created library - Click the options on the library and select
Sync
to search for any media within the library folders. (this may take a while depending on the size of your library) - Navigate to home and you should see your media and images start to load and be generated.
There is no functionality yet to add a user from the frontend yet soo you will have to post to an endpoint of the API in order to create a user for the time being.
POST http://localhost:5120/api/user
Content-Type: application/json
{
"username": "someUsername",
"password": "somePassword"
}
This functionality is still very basic and every time the site loads for the first time you will have to go to the settings section and select the user which you want to be "logged in" as. There are plans to expand on this in the future at the moment the focus is more on the video management side of things.