mirror of
https://github.com/Arcadia-Solutions/arcadia.git
synced 2025-12-21 09:19:33 -06:00
added redis setup in compose.yml and in the docs
This commit is contained in:
@@ -6,7 +6,7 @@ pub type Result<T> = std::result::Result<T, RedisError>;
|
||||
pub enum RedisError {
|
||||
#[error("connection error")]
|
||||
ConnectionError(#[source] PoolError<redis::RedisError>),
|
||||
#[error("cmd execution error")]
|
||||
#[error("cmd execution error: '{0}'")]
|
||||
CmdError(#[source] redis::RedisError),
|
||||
}
|
||||
|
||||
|
||||
20
compose.yml
20
compose.yml
@@ -20,7 +20,7 @@ services:
|
||||
- backend/.env.docker
|
||||
- backend/.env
|
||||
healthcheck:
|
||||
test: [ "CMD-SHELL", "pg_isready -U arcadia" ]
|
||||
test: ["CMD-SHELL", "pg_isready -U arcadia"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -40,6 +40,20 @@ services:
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
|
||||
redis:
|
||||
image: redis
|
||||
container_name: arcadia_redis
|
||||
restart: always
|
||||
ports:
|
||||
- 6379:6379
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
env_file:
|
||||
- backend/api/.env.docker
|
||||
- backend/api/.env
|
||||
command: redis-server --requirepass ${REDIS_PASSWORD}
|
||||
|
||||
backend:
|
||||
container_name: arcadia_api
|
||||
volumes:
|
||||
@@ -49,7 +63,7 @@ services:
|
||||
context: backend
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- '8080:8080'
|
||||
- "8080:8080"
|
||||
env_file:
|
||||
- backend/api/.env.docker
|
||||
- backend/api/.env
|
||||
@@ -68,7 +82,6 @@ services:
|
||||
- .env
|
||||
- .env.docker
|
||||
|
||||
|
||||
frontend:
|
||||
container_name: arcadia_frontend
|
||||
build:
|
||||
@@ -89,5 +102,6 @@ services:
|
||||
|
||||
volumes:
|
||||
db_data:
|
||||
redis_data:
|
||||
cargo-registry:
|
||||
cargo-target:
|
||||
|
||||
@@ -27,9 +27,11 @@ Also don't forget to use `sudo` if you aren't in the `docker` group!
|
||||
|
||||
2. **Start all services**:
|
||||
```bash
|
||||
docker compose up -d
|
||||
docker compose up --env-file backend/api/.env -d
|
||||
```
|
||||
|
||||
Note: the `--env-file` option is necessary as it will make the `REDIS_PASSWORD` environment variable available before the container is ran (and not only for the container itself, it is not the same as the compose attribute `env_file`).
|
||||
|
||||
This command will:
|
||||
- Build the backend and frontend images
|
||||
- Start PostgreSQL database
|
||||
@@ -50,6 +52,11 @@ If you prefer to start services individually:
|
||||
docker compose up db -d
|
||||
```
|
||||
|
||||
### Redis Only
|
||||
```bash
|
||||
docker compose up --env-file backend/api/.env redis -d
|
||||
```
|
||||
|
||||
### Backend Api Only
|
||||
```bash
|
||||
docker compose up backend -d
|
||||
|
||||
@@ -7,6 +7,7 @@ This page explains how to install and run Arcadia directly on your system withou
|
||||
Before starting, ensure you have the following installed:
|
||||
|
||||
- **PostgreSQL** - Database server
|
||||
- **Redis** - Cache for the auth
|
||||
- **Rust & Cargo** - Required to build the backend
|
||||
- **Node.js & npm** - Required to build the frontend
|
||||
- **Git** - To clone the repository
|
||||
@@ -17,8 +18,9 @@ For development tool installation instructions, see the [Developer Setup](dev-se
|
||||
|
||||
1. Clone the repository and navigate to it
|
||||
2. Set up PostgreSQL database
|
||||
3. Configure and run the backend
|
||||
4. Configure and run the frontend
|
||||
3. Set up Redis
|
||||
4. Configure and run the backend
|
||||
5. Configure and run the frontend
|
||||
|
||||
## Database Setup
|
||||
|
||||
@@ -83,6 +85,10 @@ cd backend/storage
|
||||
sqlx migrate run --database-url postgresql://arcadia:your_secure_password@localhost:5432/arcadia
|
||||
```
|
||||
|
||||
## Redis setup
|
||||
|
||||
[Official docs](https://redis.io/docs/latest/operate/oss_and_stack/install/archive/install-redis/)
|
||||
|
||||
## Backend Setup
|
||||
|
||||
### 1. Environment Configuration
|
||||
|
||||
Reference in New Issue
Block a user