feat: Add support for docker deploy

This commit is contained in:
wengchaoxi 2024-03-29 15:30:57 +08:00
parent c30a11744d
commit 5f8fdf9117
No known key found for this signature in database
GPG Key ID: B0A9EFEC3853F0D8
4 changed files with 71 additions and 1 deletions

44
.dockerignore Normal file
View File

@ -0,0 +1,44 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# local env files
.env*.local
.env
# vercel
.vercel
# typescript
*.tsbuildinfo
next-env.d.ts
.idea
public/
Dockerfile
docker-compose.yml
README*.md

1
.gitignore vendored
View File

@ -27,6 +27,7 @@ yarn-error.log*
# local env files # local env files
.env*.local .env*.local
.env
# vercel # vercel
.vercel .vercel

16
Dockerfile Normal file
View File

@ -0,0 +1,16 @@
# syntax=docker/dockerfile:1
FROM node:lts-alpine AS builder
WORKDIR /src
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
FROM node:lts-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --only=production
COPY --from=builder /src/.next ./.next
EXPOSE 3000
CMD ["npm", "run", "start"]

9
docker-compose.yml Normal file
View File

@ -0,0 +1,9 @@
version: '3'
services:
suno-api:
build: .
volumes:
- ./public:/app/public
ports:
- "3000:3000"