Setup Guide
Docker Deployment
- Clone the repository:
git clone git@github.com:emirage-niallchen/TrackResume.git
- Enter a new directory:
cd TrackResume
- Create or Editor docker-compose.yml file:
vim docker-compose.yml # or use any text editor
Note: These steps pull the project and use the docker-compose.yml file. You can also download it manually.
- docker-compose.yml file from the project and modify environment variables:
version: '3.8'
services:
app:
image: niallchen/track-resume:latest
container_name: TrackResume
restart: unless-stopped
ports:
- "3000:3000"
environment:
MYSQL_DATABASE_URL: mysql://user:password@ip:port/cv_dev?connection_limit=5&connect_timeout=60&acquire_timeout=60&timeout=60&pool_timeout=60
JWT_SECRET: f14w5er468ergwd486jh31gh3e5t4h863yr431fv165tr4uj86r
NEXTAUTH_URL: http://localhost:3000
NEXTAUTH_SECRET: rwgq5ret6746f4e6ew7t684d6wq464fd6a74tg867
NEXT_TELEMETRY_DISABLED: 1
volumes:
- ./public/uploads:/app/public/uploads
- ./public/project:/app/public/project
Note:
-
Replace MYSQL_DATABASE_URL with your MySQL connection link.
-
Set JWT_SECRET and NEXTAUTH_SECRET to random strings.
-
NEXTAUTH_URL should be set to the base URL for the project such as:
(e.g., https://ip:port or https://your_endpoint.com).
- The /app/public/uploads and /app/public/project directories store project files and must be mounted to persist data to disk.
- Set appropriate permissions:
chmod 775 ./public/uploads ./public/project
注:赋予系统写入路径权限;
- Start the container:
docker-compose up -d
Installing from Source
- Clone the repository:
git clone <repository-url>
- Enter the project directory:
cd TrackResume
- Install dependencies:
npm install
- Configure the database:
- Modify
.env.examplein the root directory to.envand add database connection info
DATABASE_URL="mysql://username:password@ip:port/database"
- Initialize the database:
npx prisma db push
- Build for production:
npm run build
- Start the production server:
npm run start