diff --git a/.env b/.env index d7ca3b3..cf1db3d 100644 --- a/.env +++ b/.env @@ -1,11 +1,18 @@ -# General -GIT_WORK_DIR=/tmp/nocturne/blog_posts_git +# postgres settings +DB_HOST=localhost +DB_PORT=5432 +POSTGRES_PASSWORD= +POSTGRES_USER= +POSTGRES_DB=nocturne + +# backend settings +GIT_WORK_DIR=../blog_posts_git BLOG_ENDPOINT=https://github.com/Lumither/blog-posts.git LOG_ROOT_DIR=/var/log/nocturne - -# Backend -BACKEND_URL=https://lumither.com/api BACKEND_PORT=3001 -## Database related -DB_CONNECTION=postgresql://localhost:5432/nocturne +# frontend settings +API_LOCAL_URL=http://localhost:3001 +API_REMOTE_URL=https://lumither.com/api + + diff --git a/.gitignore b/.gitignore index 7a62a31..6299755 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # confidential .env.* +/container/*/.env # idea related .idea diff --git a/backend/.env b/backend/.env deleted file mode 100644 index d7ca3b3..0000000 --- a/backend/.env +++ /dev/null @@ -1,11 +0,0 @@ -# General -GIT_WORK_DIR=/tmp/nocturne/blog_posts_git -BLOG_ENDPOINT=https://github.com/Lumither/blog-posts.git -LOG_ROOT_DIR=/var/log/nocturne - -# Backend -BACKEND_URL=https://lumither.com/api -BACKEND_PORT=3001 - -## Database related -DB_CONNECTION=postgresql://localhost:5432/nocturne diff --git a/container/dev/frontend.containerfile b/container/dev/frontend.containerfile index fa74be7..5804803 100644 --- a/container/dev/frontend.containerfile +++ b/container/dev/frontend.containerfile @@ -1,14 +1,13 @@ # docker/dev.Dockerfile -FROM oven/bun:latest +FROM node:latest WORKDIR /app COPY package.json ./ -COPY bun.lockb ./ -RUN bun install +RUN npm install ENV NEXT_TELEMETRY_DISABLED 1 -CMD bun run dev +CMD npm run dev diff --git a/dev.compose.yaml b/dev.compose.yaml index 96d42e4..1a7bf29 100644 --- a/dev.compose.yaml +++ b/dev.compose.yaml @@ -7,11 +7,13 @@ services: ports: - 3000:3000 volumes: - - ./frontend:/app:ro + - ./frontend:/app - /app/node_modules - /app/.next env_file: - - .env.dev + - ./container/dev/.env + dns: + - 1.1.1.1 backend: @@ -24,11 +26,11 @@ services: volumes: - ./blog_posts_git:/app/blog_posts_git:ro env_file: - - .env.dev + - ./container/dev/.env postgres: image: postgres:16.3 ports: - 5432:5432 env_file: - - .env.dev + - ./container/dev/.env diff --git a/frontend/.env b/frontend/.env deleted file mode 100644 index d7ca3b3..0000000 --- a/frontend/.env +++ /dev/null @@ -1,11 +0,0 @@ -# General -GIT_WORK_DIR=/tmp/nocturne/blog_posts_git -BLOG_ENDPOINT=https://github.com/Lumither/blog-posts.git -LOG_ROOT_DIR=/var/log/nocturne - -# Backend -BACKEND_URL=https://lumither.com/api -BACKEND_PORT=3001 - -## Database related -DB_CONNECTION=postgresql://localhost:5432/nocturne diff --git a/dev_server.sh b/scripts/dev_server.sh similarity index 100% rename from dev_server.sh rename to scripts/dev_server.sh diff --git a/flush_env.sh b/scripts/flush_env.sh similarity index 100% rename from flush_env.sh rename to scripts/flush_env.sh diff --git a/refresh.sh b/scripts/refresh.sh similarity index 100% rename from refresh.sh rename to scripts/refresh.sh diff --git a/setup.sh b/scripts/setup.sh similarity index 100% rename from setup.sh rename to scripts/setup.sh diff --git a/start_server.sh b/scripts/start_server.sh similarity index 91% rename from start_server.sh rename to scripts/start_server.sh index cfde8ca..50c2199 100755 --- a/start_server.sh +++ b/scripts/start_server.sh @@ -4,12 +4,17 @@ /bin/bash ./flush_env.sh # start frontend +( cd frontend || exit +bun i bun next build screen -S nocturne_frontend -d -m bun start cd .. +) & # start backend +( cd backend || exit screen -S nocturne_backend -d -m cargo r -r cd .. +) & wait