Skip to content

Commit 71da78c

Browse files
author
Lasim
committed
frontend: update environment variable references to use VITE_DEPLOYSTACK_APP_URL
1 parent 0b2206f commit 71da78c

File tree

4 files changed

+42
-3
lines changed

4 files changed

+42
-3
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,45 @@ You can also run DeployStack on your own infrastructure for maximum control:
100100
npm run dev:backend
101101
```
102102

103+
#### Deploying with Docker
104+
105+
Alternatively, you can deploy the pre-built Docker images for the frontend and backend services.
106+
107+
1. **Pull the latest images from Docker Hub:**
108+
109+
```bash
110+
docker pull deploystack/frontend:latest
111+
docker pull deploystack/backend:latest
112+
```
113+
114+
2. **Run the Backend Service:**
115+
116+
The backend requires a persistent volume for its data (like database configuration and SQLite files). The following command maps a local directory (`./services/backend/persistent_data`) to the container's data directory. It's recommended to run this command from the root of the cloned DeployStack project directory.
117+
118+
```bash
119+
docker run -d \
120+
-p 3000:3000 \
121+
-v $(pwd)/services/backend/persistent_data:/app/persistent_data \
122+
deploystack/backend:latest
123+
```
124+
125+
3. **Run the Frontend Service:**
126+
127+
The frontend requires environment variables to connect to the backend and for other configurations.
128+
129+
```bash
130+
docker run -d \
131+
-p 8080:80 \ # Exposes frontend on host port 8080, container runs on 80
132+
-e VITE_DEPLOYSTACK_APP_URL="http://localhost:3000" \ # URL of your backend service
133+
-e VITE_APP_TITLE="Your DeployStack Title" \
134+
# Add any other environment variables as needed
135+
deploystack/frontend:latest
136+
```
137+
138+
**Note:**
139+
- Ensure the `VITE_DEPLOYSTACK_APP_URL` points to where your backend service is accessible. If running both containers on the same Docker host, `http://localhost:3000` (or the host's IP/hostname if `localhost` doesn't resolve correctly from within the frontend container's network to the backend's exposed port) should work.
140+
- The `$(pwd)` in the backend command assumes you are in the root of the `deploystack` project directory. Adjust the path to `services/backend/persistent_data` if running from elsewhere, or use an absolute path or a Docker named volume.
141+
103142
## Project Structure
104143

105144
This repository uses a monorepo structure optimized for MCP server deployment:

services/frontend/src/services/database.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class DatabaseService {
77
private baseUrl: string;
88

99
constructor() {
10-
this.baseUrl = getEnv('VITE_API_URL') || 'http://localhost:3000';
10+
this.baseUrl = getEnv('VITE_DEPLOYSTACK_APP_URL') || 'http://localhost:3000';
1111
}
1212

1313
/**

services/frontend/src/views/Login.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ const onSubmit = form.handleSubmit(async (values) => {
163163
164164
import { getEnv, getAllEnv } from '@/utils/env';
165165
166-
const apiUrl = getEnv('VITE_API_URL');
166+
const apiUrl = getEnv('VITE_DEPLOYSTACK_APP_URL');
167167
168168
const allEnv = getAllEnv();
169169

services/frontend/src/views/Register.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const successMessage = ref('')
3737
const { t } = useI18n() // Initialize i18n composable
3838
3939
// Get API URL from environment
40-
const apiUrl = getEnv('VITE_API_URL')
40+
const apiUrl = getEnv('VITE_DEPLOYSTACK_APP_URL')
4141
4242
// Define validation schema using Zod
4343
const formSchema = toTypedSchema(

0 commit comments

Comments
 (0)