Migrate front end to Mantine

This commit is contained in:
2023-09-22 16:44:30 -04:00
parent ab4073f280
commit 02a4d840e0
17 changed files with 102 additions and 113 deletions

View File

@@ -11,22 +11,25 @@ help: ## This info
@cat Makefile | grep -E '^[a-zA-Z\/_-]+:.*?## .*$$' | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@echo
up:
build: ## Build Docker service container
docker compose build
up: ## Start Docker service containers
docker compose up -d
down:
down: ## Stop Docker service containers
docker compose down
connect:
connect: ## Connect to the Weather DB
docker exec -it aviation_weather_db psql -U postgres
lint: ## Run the linter
npm run lint
clean:
clean: ## Clean up the service
rm -rf target
clean-db: ## Remove database and Cargo packages
clean-db: ## Remove database
docker exec -i ${DATABASE_CONTAINER} sh -c 'PGPASSWORD=${DATABASE_PASSWORD} psql -U ${DATABASE_USER} -d postgres -c "DROP DATABASE IF EXISTS \"${DATABASE_NAME}\";"'
docker exec -i ${DATABASE_CONTAINER} sh -c 'PGPASSWORD=${DATABASE_PASSWORD} psql -U ${DATABASE_USER} -d postgres -c "CREATE DATABASE \"${DATABASE_NAME}\";"' || true

View File

@@ -1,9 +1,10 @@
version: '3'
name: weather
services:
weather-db:
db:
image: postgis/postgis:latest
container_name: weather.db
container_name: weather-db
env_file:
- .env
environment:
@@ -17,6 +18,22 @@ services:
- "${DATABASE_PORT}:5432"
restart: unless-stopped
service:
container_name: weather-service
env_file:
- .env
ports:
- "${SERVICE_PORT}:${SERVICE_PORT}"
build:
context: ./
depends_on:
- db
restart: unless-stopped
volumes:
db:
db_logs:
db_logs:
networks:
default:
name: weather-backend

View File

@@ -44,8 +44,8 @@ async fn main() -> std::io::Result<()> {
server = match listenfd.take_tcp_listener(0)? {
Some(listener) => server.listen(listener)?,
None => {
let host = std::env::var("HOST").expect("Please set host in .env");
let port = std::env::var("PORT").expect("Please set port in .env");
let host = std::env::var("SERVICE_HOST").expect("Please set host in .env");
let port = std::env::var("SERVICE_PORT").expect("Please set port in .env");
debug!("Binding server to {}:{}", host, port);
server.bind(format!("{}:{}", host, port))?
}