Updated the Obsidian docs-vault
This commit is contained in:
1 parent
72fd77ee01
commit
260282a0e2
36 files changed
+3497
-144
No files matched your search
@@ -1,12 +1,88 @@
|
||||
---
|
||||
title: Deployment
|
||||
tags:
|
||||
- deployment
|
||||
- docker
|
||||
- infrastructure
|
||||
---
|
||||
|
||||
# Deployment
|
||||
|
||||
## Overview
|
||||
|
||||
Docker-based deployment using `docker-compose.yml` at project root.
|
||||
Showy can be deployed via Docker Compose (server) or as an Electron desktop app (local). See [[Electron]] for desktop deployment.
|
||||
|
||||
## Docker Compose
|
||||
|
||||
> [!info] File: `docker-compose.yml` (v3.9)
|
||||
|
||||
### Services
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
FE[Frontend :3000] --> BE[Backend :4000]
|
||||
BE --> DB[(MySQL :3306)]
|
||||
```
|
||||
|
||||
#### Frontend
|
||||
|
||||
- **Build:** Root Dockerfile
|
||||
- **Args:** `API_URL`, `TMDB_API_KEY`
|
||||
- **Port:** `3000:80`
|
||||
- **Depends on:** backend
|
||||
- Uses Nginx to serve static files (`frontend/nginx.conf`)
|
||||
|
||||
#### Backend
|
||||
|
||||
- **Build:** `backend/Dockerfile`
|
||||
- **Port:** `4000:4000`
|
||||
- **Depends on:** mysql
|
||||
- **Environment:**
|
||||
- `MYSQL_HOST=mysql`
|
||||
- `MYSQL_DB=Showzy`
|
||||
- `MYSQL_USER=root`
|
||||
- `MYSQL_PASSWORD=password`
|
||||
|
||||
#### MySQL
|
||||
|
||||
- **Image:** `mysql:8.0`
|
||||
- **Port:** `3306:3306`
|
||||
- **Environment:**
|
||||
- `MYSQL_ROOT_PASSWORD=rootpassword`
|
||||
- `MYSQL_DATABASE=mydatabase`
|
||||
- **Volume:** `db_data:/var/lib/mysql` (persistent)
|
||||
|
||||
### Build & Run
|
||||
|
||||
```bash
|
||||
docker-compose up -d --build
|
||||
```
|
||||
|
||||
## Backend Dockerfile
|
||||
|
||||
| Step | Action |
|
||||
|---|---|
|
||||
| Base | `node:18` (or similar) |
|
||||
| Copy | `package.json`, `pnpm-lock.yaml` |
|
||||
| Install | `pnpm install` |
|
||||
| Copy | All source files |
|
||||
| Expose | Port 4000 |
|
||||
| CMD | `node server.js` |
|
||||
|
||||
## Important Files
|
||||
|
||||
- `docker-compose.yml` — Compose orchestration
|
||||
- `backend/Dockerfile` — Backend container
|
||||
- `frontend/Dockerfile` — Angular frontend container (legacy)
|
||||
- `frontend/nginx.conf` — Nginx config for frontend serving
|
||||
| File | Role |
|
||||
|---|---|
|
||||
| `docker-compose.yml` | Multi-container orchestration |
|
||||
| `backend/Dockerfile` | Backend container build |
|
||||
| `frontend/Dockerfile` | Legacy Angular frontend container |
|
||||
| `frontend/nginx.conf` | Nginx static file config |
|
||||
|
||||
> [!note] Legacy Frontend
|
||||
> The Docker setup currently uses the Angular frontend (`/frontend`). The React frontend (`/react_frontend`) is the active development target but may not yet be containerized.
|
||||
|
||||
## See Also
|
||||
|
||||
- [[Env]] — Environment variables
|
||||
- [[Electron]] — Desktop deployment alternative
|
||||
- [[Architecture]] — System overview
|
||||
Reference in new issue
Block a user