mirror of
https://github.com/civitai/civitai.git
synced 2026-09-20 22:08:18 +08:00
Updates docker-compose and README
This commit is contained in:
+23
-7
@@ -5,13 +5,14 @@
|
||||
# When adding additional env variables, the schema in /env/schema.mjs should be updated accordingly
|
||||
|
||||
# Prisma
|
||||
DATABASE_URL=postgresql://postgres:postgres@locahost:5432/postgres
|
||||
DATABASE_URL=postgresql://modelshare:postgres@localhost:5432/postgres?schema=public&connection_limit=5
|
||||
REDIS_URL=redis://:redis@localhost:6379
|
||||
|
||||
# Logging
|
||||
LOGGING=session-helpers,prisma:error,prisma:warn,prisma:query,update-metrics
|
||||
|
||||
# Next Auth
|
||||
NEXTAUTH_SECRET=
|
||||
NEXTAUTH_SECRET=thisisnotasecret
|
||||
NEXTAUTH_URL=http://localhost:3000
|
||||
|
||||
# Next Auth Discord Provider
|
||||
@@ -31,20 +32,25 @@ REDDIT_CLIENT_ID=
|
||||
REDDIT_CLIENT_SECRET=
|
||||
|
||||
# File uploading
|
||||
S3_UPLOAD_BUCKET=model-share
|
||||
S3_UPLOAD_REGION=auto
|
||||
S3_UPLOAD_ENDPOINT=
|
||||
S3_UPLOAD_KEY=
|
||||
S3_UPLOAD_SECRET=
|
||||
S3_UPLOAD_BUCKET=
|
||||
S3_UPLOAD_REGION=
|
||||
S3_UPLOAD_ENDPOINT=
|
||||
S3_SETTLED_BUCKET=
|
||||
S3_ORIGINS=
|
||||
CF_IMAGES_TOKEN=
|
||||
CF_ACCOUNT_ID=
|
||||
|
||||
# Client env vars
|
||||
NEXT_PUBLIC_IMAGE_LOCATION=
|
||||
NEXT_PUBLIC_CONTENT_DECTECTION_LOCATION=
|
||||
NEXT_PUBLIC_CIVITAI_LINK=https://link.civitai.com
|
||||
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=
|
||||
|
||||
# Email
|
||||
EMAIL_HOST=
|
||||
EMAIL_PORT=
|
||||
EMAIL_SECURE=
|
||||
EMAIL_USER=
|
||||
EMAIL_PASS=
|
||||
EMAIL_FROM=
|
||||
@@ -61,4 +67,14 @@ MAINTENANCE_MODE=false
|
||||
|
||||
# Security
|
||||
SCANNING_ENDPOINT=http://scan-me.civitai.com/enqueue
|
||||
SCANNING_TOKEN=
|
||||
SCANNING_TOKEN=thisisnotatoken
|
||||
|
||||
|
||||
# Payments
|
||||
STRIPE_SECRET_KEY=thisisnotakey
|
||||
STRIPE_WEBHOOK_SECRET=thisisnotasecret
|
||||
STRIPE_DONATE_ID=price_1MZHyDLAn4if8jivVbH5PhMc
|
||||
STRIPE_METADATA_KEY=tier
|
||||
|
||||
# Features
|
||||
FEATURE_FLAG_EARLY_ACCESS_MODEL=public
|
||||
|
||||
@@ -14,8 +14,7 @@
|
||||
|
||||
## Table of Content
|
||||
- [About the Project](#about-the-project)
|
||||
- [Built with](#built-with)
|
||||
- [Features](#features)
|
||||
- [Tech Stack](#tech-stack)
|
||||
- [Getting Started](#getting-started)
|
||||
- [Prerequisites](#prerequisites)
|
||||
- [Installation](#installation)
|
||||
@@ -24,43 +23,19 @@
|
||||
- [Sponsors](#sponsors)
|
||||
- [License](#license)
|
||||
|
||||
|
||||
|
||||
## About the Project
|
||||
|
||||

|
||||
Our goal with this project is to create a platform where people can share their stable diffusion models (textual inversions, hypernetworks, aesthetic gradients, VAEs, and any other crazy stuff people do to customize their AI generations), collaborate with others to improve them, and learn from each other's work. The platform allows users to create an account, upload their models, and browse models that have been shared by others. Users can also leave comments and feedback on each other's models to facilitate collaboration and knowledge sharing.
|
||||
|
||||
Share you models, textual inversions, hypernetworks, aesthetic gradients, VAEs, and any other crazy stuff people do to customize their AI generations.
|
||||
### Tech Stack
|
||||
|
||||
We've built this project using a combination of modern web technologies, including Next.js for the frontend, TRPC for the API, and Prisma + Postgres for the database. By leveraging these tools, we've been able to create a scalable and maintainable platform that is both user-friendly and powerful.
|
||||
|
||||
### Built with
|
||||
- **DB:** Prisma + Postgres
|
||||
- **API:** tRPC
|
||||
- **Front-end + Back-end:** NextJS
|
||||
- **UI Kit:** [Mantine](https://mantine.dev/)
|
||||
- **Storage:** Cloudflare
|
||||
- **Hosting:** Railway
|
||||
|
||||
### Features
|
||||
- Browse Models
|
||||
- Name, tags, downloads, favorites
|
||||
- Interacting with Models
|
||||
- Name
|
||||
- Trained Words (a list of words that this model knows)
|
||||
- Description
|
||||
- Type (Model, Textual Inversion)
|
||||
- Example Images
|
||||
- Versions
|
||||
- Name
|
||||
- Changelog/Description/Notes
|
||||
- Training Images (optional)
|
||||
- Training Steps
|
||||
- Download (Tracked)
|
||||
- Tag (Completely open)
|
||||
- Reviews
|
||||
- Version
|
||||
- Images Attachments
|
||||
- Text Review
|
||||
- Rate (Star system 1-5)
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -68,28 +43,28 @@ To get a local copy up and running follow these simple example steps.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
We recommend you have installed `nvm` in order to set the right node version to run this project
|
||||
```sh
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
|
||||
```
|
||||
First, make sure that you have the following installed on your machine:
|
||||
- Node.js (version 18 or later)
|
||||
- Docker (for running the database)
|
||||
|
||||
> We recommend you have installed `nvm` in order to set the right node version to run this project
|
||||
> ```sh
|
||||
> curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
|
||||
> ```
|
||||
|
||||
### Installation
|
||||
|
||||
1. Clone the repo
|
||||
```sh
|
||||
git clone https://github.com/civitai/civitai.git
|
||||
```
|
||||
1. Install NPM packages
|
||||
```sh
|
||||
npm install
|
||||
```
|
||||
1. Config your env vars
|
||||
```sh
|
||||
cp .env-example .env
|
||||
```
|
||||
1. Clone the repository to your local machine.
|
||||
1. Run `npm install` in the project directory to install the necessary dependencies.
|
||||
1. Create your `.env` by making a copy of the contents from `.env-example` file.
|
||||
1. Spin up the database with `docker-compose up -d`.
|
||||
1. Start the development server by running `npm run dev`.
|
||||
1. Visit [http://localhost:3000](http://localhost:3000).
|
||||
|
||||
### Important Scripts
|
||||
```sh
|
||||
docker-compose up -d # Spin up db and redis
|
||||
|
||||
npm run dev # Start the dev environment
|
||||
|
||||
npm run db:migrate -- --name migration-name # Create a database migration with prisma after updating the schema
|
||||
@@ -108,11 +83,11 @@ Any contributions you make are **greatly appreciated**.
|
||||
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
|
||||
Don't forget to give the project a star! Thanks again!
|
||||
|
||||
1. Fork the Project
|
||||
1. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
|
||||
1. Commit your Changes (`git commit -am 'Add some AmazingFeature'`)
|
||||
1. Push to the Branch (`git push origin feature/AmazingFeature`)
|
||||
1. Open a Pull Request
|
||||
1. Fork the repository to your own GitHub account.
|
||||
1. Create a new branch for your changes.
|
||||
1. Make your changes to the code.
|
||||
1. Commit your changes and push the branch to your forked repository.
|
||||
1. Open a pull request on our repository.
|
||||
|
||||
## Sponsors
|
||||
|
||||
|
||||
+6
-4
@@ -1,19 +1,21 @@
|
||||
version: '3.4'
|
||||
version: '3.9'
|
||||
services:
|
||||
db:
|
||||
image: postgres:alpine
|
||||
container_name: db
|
||||
ports:
|
||||
- 5432:5432
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=example
|
||||
- POSTGRES_USER=postgres
|
||||
- POSTGRES_PASSWORD=postgres
|
||||
- POSTGRES_USER=modelshare
|
||||
- POSTGRES_DB=postgres
|
||||
volumes:
|
||||
- ./postgres/data:/var/lib/postgresql/data
|
||||
restart: unless-stopped
|
||||
redis:
|
||||
image: redis:alpine
|
||||
container_name: redis
|
||||
command: redis-server --requirepass "redis-example"
|
||||
command: redis-server --requirepass "redis"
|
||||
ports:
|
||||
- 6379:6379
|
||||
volumes:
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.6 MiB |
Reference in New Issue
Block a user