Skip to content

Repository files navigation

Build guide

Requirements

  • docker (with docker compose) link
  • .net 9 sdk link
  • entity framework .net tool (for DB migrations and updates) link
  • node.js (for frontend app) link
  • angular cli link

This script may be used on Ubuntu 24.04 to install .NET 9 SDK This script may be used on Ubuntu 24.04 to install .NET EntityFramework tool THis script may be used on Ubuntu 24.04 to install docker

NOTE: it is recommended to add active dev user to docker group via command:

sudo usermod -aG docker $USER

Node.js installation

  1. Install dependency:
sudo apt install unzip
  1. Download fnm (described in details here:
curl -o- https://fnm.vercel.app/install | bash
  1. Restart terminal (e.g. logout and reloging via ssh)

  2. install node.js and npm via fnm:

fnm install 22

Angular CLI installation (requires node.js with NPM)

npm install -g @angular/cli

Release build (dockerized)

0 Clone this repo

NOTE: configured SSH-key authentication is required for submodules to work properly

git clone --recursive git@git.ooplabs.ru:trspo/course-projects/blogator/blogatorbuild.git

1 Build frontend app (required node.js)

./build-admin-panel

2 Bootstrap containers:

docker compose pull
docker compose build
docker compose up -d

3 Check that the containers are up and ready:

docker compose ps

Should yeild something like this:

NAME                       IMAGE                    COMMAND                  SERVICE    CREATED          STATUS         PORTS
blogatorbuild-blogator-1   blogatorbuild-blogator   "dotnet BlogAtor.Run…"   blogator   2 seconds ago    Up 2 seconds   0.0.0.0:8080->8080/tcp, :::8080->8080/tcp
blogatorbuild-db-1         postgres                 "docker-entrypoint.s…"   db         24 minutes ago   Up 2 seconds   0.0.0.0:5432->5432/tcp, :::5432->5432/tcp
blogatorbuild-web-1        nginx                    "/docker-entrypoint.…"   web        24 minutes ago   Up 2 seconds   0.0.0.0:80->80/tcp, :::80->80/tcp

4 Setup database:

  1. Add local BlogAtor config to /etc/
  • create folder /etc/blogator
sudo mkdir /etc/blogator/
  • create local BlogAtor config in '/etc/blogator/StartupConfig.json' via yout text editor of choice. Paste the following text into the config:
{
	"DbConnection" : "Host=localhost; Database=blogator; Username=dbuser; Password=dbpwd"
}
  1. Add initial migration:
./add-migration init
  1. Apply DB schema to PostgreSQL container (db container should be running):
./setup-db

5 Check that the site is live:

Go to localhost or your PC's IP-address via HTTP (:80) in the browser

NOTE: To drop database use delete DB volumes:

docker compose down -v

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages