Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Docker section for self host #279

Merged
merged 3 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,26 @@ Commands:

<!-- /automd -->

## Self-Hosting with Docker

To self-host the Shelve application using the Docker image available on GitHub, follow these steps:

1. **Pull the Docker Image**:
```sh
docker pull ghcr.io/hugorcd/shelve:latest
```

2. **Run the Docker Container**:
```sh
docker run -d -p 8080:80 --name shelve-app ghcr.io/hugorcd/shelve:latest
```

3. **Access the Application**:
Open your browser and navigate to `http://localhost:8080` to access the Shelve application.

Ensure you have Docker installed and running on your machine before executing these commands. For more information on Docker, refer to the [official Docker documentation](https://docs.docker.com/get-docker/).


<!-- automd:fetch url="gh:hugorcd/markdown/main/src/contributions.md" -->

## Contributing
Expand Down
1 change: 1 addition & 0 deletions apps/lp/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default defineNuxtConfig({
routeRules: {
'/': { isr: true, prerender: true },
'/vault': { isr: true, prerender: true },
'/docs': { isr: true, prerender: true },
},

modules: [
Expand Down
Binary file modified bun.lockb
Binary file not shown.
24 changes: 12 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ services:
# Runtime essentials
- DATABASE_URL=${DATABASE_URL} # DATABASE_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@shelve_db:5432/${POSTGRES_DB:-postgres}
- NUXT_PRIVATE_REDIS_URL=${NUXT_PRIVATE_REDIS_URL:-redis://shelve_redis:6379} # NUXT_PRIVATE_REDIS_URL=redis://shelve_redis:6379
- NUXT_PRIVATE_ENCRYPTION_KEY=${NUXT_PRIVATE_ENCRYPTION_KEY}
- NUXT_SESSION_PASSWORD=${NUXT_SESSION_PASSWORD}
- NUXT_PRIVATE_ENCRYPTION_KEY=${NUXT_PRIVATE_ENCRYPTION_KEY} # Encryption key for securing sensitive data
- NUXT_SESSION_PASSWORD=${NUXT_SESSION_PASSWORD} # Password for session management

# OAuth
- NUXT_OAUTH_GITHUB_CLIENT_ID=${NUXT_OAUTH_GITHUB_CLIENT_ID}
- NUXT_OAUTH_GITHUB_CLIENT_SECRET=${NUXT_OAUTH_GITHUB_CLIENT_SECRET}
- NUXT_OAUTH_GITHUB_CLIENT_ID=${NUXT_OAUTH_GITHUB_CLIENT_ID} # Client ID for GitHub OAuth
- NUXT_OAUTH_GITHUB_CLIENT_SECRET=${NUXT_OAUTH_GITHUB_CLIENT_SECRET} # Client secret for GitHub OAuth

# Public configs
- NUXT_PUBLIC_APP_URL=${NUXT_PUBLIC_APP_URL}
- NUXT_PUBLIC_APP_URL=${NUXT_PUBLIC_APP_URL} # Public URL of your application

# Optional services
- NUXT_PRIVATE_RESEND_API_KEY=${NUXT_PRIVATE_RESEND_API_KEY}
- NUXT_PRIVATE_RESEND_API_KEY=${NUXT_PRIVATE_RESEND_API_KEY} # API key for the Resend service (optional)
ports:
- "3000:3000"
healthcheck:
Expand Down Expand Up @@ -52,9 +52,9 @@ services:
ports:
- "3001:3000"
environment:
- NUXT_PUBLIC_SITE_URL=${NUXT_PUBLIC_SITE_URL}
- NUXT_PRIVATE_VAULT_URL=${NUXT_PRIVATE_VAULT_URL}
- NUXT_PRIVATE_ENCRYPTION_KEY=${NUXT_PRIVATE_ENCRYPTION_KEY}
- NUXT_PUBLIC_SITE_URL=${NUXT_PUBLIC_SITE_URL} # Public URL of the site
- NUXT_PRIVATE_VAULT_URL=${NUXT_PRIVATE_VAULT_URL} # URL of the vault service
- NUXT_PRIVATE_ENCRYPTION_KEY=${NUXT_PRIVATE_ENCRYPTION_KEY} # Encryption key for securing sensitive data
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:3000/api/hello" ]
interval: 30s
Expand All @@ -67,9 +67,9 @@ services:
volumes:
- postgres:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-postgres}
POSTGRES_USER: ${POSTGRES_USER:-postgres} # PostgreSQL user
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres} # PostgreSQL password
POSTGRES_DB: ${POSTGRES_DB:-postgres} # PostgreSQL database name
healthcheck:
test: [ "CMD", "pg_isready", "-U", "postgres" ]
interval: 30s
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { createShelveConfig } from "@shelve/cli"
export default createShelveConfig({
project: "my-project", // only required field
token: "my-token",
url: "https://shelve.cloud",
url: "https://app.shelve.cloud",
confirmChanges: false,
pushMethod: 'overwrite',
pullMethod: 'overwrite',
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shelve/cli",
"version": "2.5.1",
"version": "2.5.2",
"description": "The command-line interface for Shelve",
"homepage": "https://shelve.cloud",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { onCancel } from './index'

export async function getToken(): Promise<string> {
const token = await password({
message: 'Please provide a valid token (you can generate one on https://shelve.cloud/app/tokens)',
message: 'Please provide a valid token (you can generate one on https://app.shelve.cloud/tokens)',
validate(value) {
if (value.length === 0) return `Value is required!`
},
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export async function getConfig(): Promise<{
project: process.env.SHELVE_PROJECT,
// @ts-expect-error to provide error message we let token be undefined
token: process.env.SHELVE_TOKEN,
url: process.env.SHELVE_URL || 'https://shelve.cloud',
url: process.env.SHELVE_URL || 'https://app.shelve.cloud',
confirmChanges: false,
pullMethod: 'overwrite',
pushMethod: 'overwrite',
Expand Down