feat(global) container and project structure update

This commit is contained in:
lumither committed 2024-08-13 22:32:04 +08:00
1 parent fbc9736831
commit 9f72bb01b7
11 files changed
+29 -37

No files matched your search

+14 -7
View File
@@ -1,11 +1,18 @@
# General # postgres settings
GIT_WORK_DIR=/tmp/nocturne/blog_posts_git 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 BLOG_ENDPOINT=https://github.com/Lumither/blog-posts.git
LOG_ROOT_DIR=/var/log/nocturne LOG_ROOT_DIR=/var/log/nocturne
# Backend
BACKEND_URL=https://lumither.com/api
BACKEND_PORT=3001 BACKEND_PORT=3001
## Database related # frontend settings
DB_CONNECTION=postgresql://localhost:5432/nocturne API_LOCAL_URL=http://localhost:3001
API_REMOTE_URL=https://lumither.com/api
+1
View File
@@ -1,5 +1,6 @@
# confidential # confidential
.env.* .env.*
/container/*/.env
# idea related # idea related
.idea .idea
-11
View File
@@ -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
+3 -4
View File
@@ -1,14 +1,13 @@
# docker/dev.Dockerfile # docker/dev.Dockerfile
FROM oven/bun:latest FROM node:latest
WORKDIR /app WORKDIR /app
COPY package.json ./ COPY package.json ./
COPY bun.lockb ./
RUN bun install RUN npm install
ENV NEXT_TELEMETRY_DISABLED 1 ENV NEXT_TELEMETRY_DISABLED 1
CMD bun run dev CMD npm run dev
+6 -4
View File
@@ -7,11 +7,13 @@ services:
ports: ports:
- 3000:3000 - 3000:3000
volumes: volumes:
- ./frontend:/app:ro - ./frontend:/app
- /app/node_modules - /app/node_modules
- /app/.next - /app/.next
env_file: env_file:
- .env.dev - ./container/dev/.env
dns:
- 1.1.1.1
backend: backend:
@@ -24,11 +26,11 @@ services:
volumes: volumes:
- ./blog_posts_git:/app/blog_posts_git:ro - ./blog_posts_git:/app/blog_posts_git:ro
env_file: env_file:
- .env.dev - ./container/dev/.env
postgres: postgres:
image: postgres:16.3 image: postgres:16.3
ports: ports:
- 5432:5432 - 5432:5432
env_file: env_file:
- .env.dev - ./container/dev/.env
-11
View File
@@ -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
File renamed without changes.
File renamed without changes.
View File
File renamed without changes.
View File
File renamed without changes.
@@ -4,12 +4,17 @@
/bin/bash ./flush_env.sh /bin/bash ./flush_env.sh
# start frontend # start frontend
(
cd frontend || exit cd frontend || exit
bun i
bun next build bun next build
screen -S nocturne_frontend -d -m bun start screen -S nocturne_frontend -d -m bun start
cd .. cd ..
) &
# start backend # start backend
(
cd backend || exit cd backend || exit
screen -S nocturne_backend -d -m cargo r -r screen -S nocturne_backend -d -m cargo r -r
cd .. cd ..
) & wait