mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
change backend port from 5001 to 5003
This commit is contained in:
1 parent
ca7f976199
commit
18be821fdb
5 files changed
+20
-17
No files matched your search
+3
-3
@@ -56,7 +56,7 @@ RUN curl -fsSL https://opencode.ai/install | bash && \
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV HOST=0.0.0.0
|
||||
ENV PORT=5001
|
||||
ENV PORT=5003
|
||||
ENV OPENCODE_SERVER_PORT=5551
|
||||
ENV DATABASE_PATH=/app/data/opencode.db
|
||||
ENV WORKSPACE_PATH=/workspace
|
||||
@@ -73,10 +73,10 @@ RUN chmod +x /docker-entrypoint.sh
|
||||
|
||||
RUN mkdir -p /workspace /app/data
|
||||
|
||||
EXPOSE 5001
|
||||
EXPOSE 5003
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
|
||||
CMD curl -f http://localhost:5001/api/health || exit 1
|
||||
CMD curl -f http://localhost:5003/api/health || exit 1
|
||||
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
CMD ["bun", "backend/dist/index.js"]
|
||||
+10
-7
@@ -153,14 +153,17 @@ app.all('/api/opencode/*', async (c) => {
|
||||
const isProduction = ENV.SERVER.NODE_ENV === 'production'
|
||||
|
||||
if (isProduction) {
|
||||
app.use('/*', async (c, next) => {
|
||||
if (c.req.path.startsWith('/api/')) {
|
||||
return next()
|
||||
}
|
||||
return serveStatic({ root: './frontend/dist' })(c, next)
|
||||
})
|
||||
app.use('/*', serveStatic({ root: './frontend/dist' }))
|
||||
|
||||
app.get('*', async (c) => {
|
||||
return serveStatic({ path: './frontend/dist/index.html' })(c, async () => {})
|
||||
if (c.req.path.startsWith('/api/')) {
|
||||
return c.notFound()
|
||||
}
|
||||
const fs = await import('fs/promises')
|
||||
const path = await import('path')
|
||||
const indexPath = path.join(process.cwd(), 'frontend/dist/index.html')
|
||||
const html = await fs.readFile(indexPath, 'utf-8')
|
||||
return c.html(html)
|
||||
})
|
||||
} else {
|
||||
app.get('/', (c) => {
|
||||
|
||||
@@ -7,11 +7,11 @@ services:
|
||||
container_name: opencode-backend-dev
|
||||
command: sh -c "cd /app && bun --watch backend/src/index.ts"
|
||||
ports:
|
||||
- "5001:5001"
|
||||
- "5003:5003"
|
||||
environment:
|
||||
- NODE_ENV=development
|
||||
- HOST=0.0.0.0
|
||||
- PORT=5001
|
||||
- PORT=5003
|
||||
- OPENCODE_SERVER_PORT=5551
|
||||
- DATABASE_PATH=/app/data/opencode.db
|
||||
- WORKSPACE_PATH=/workspace
|
||||
@@ -33,7 +33,7 @@ services:
|
||||
ports:
|
||||
- "5173:5173"
|
||||
environment:
|
||||
- VITE_API_URL=http://localhost:5001
|
||||
- VITE_API_URL=http://localhost:5003
|
||||
volumes:
|
||||
- ./frontend:/app/frontend
|
||||
- ./shared:/app/shared
|
||||
|
||||
+3
-3
@@ -5,11 +5,11 @@ services:
|
||||
dockerfile: Dockerfile
|
||||
container_name: opencode-web
|
||||
ports:
|
||||
- "5001:5001"
|
||||
- "5003:5003"
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- HOST=0.0.0.0
|
||||
- PORT=5001
|
||||
- PORT=5003
|
||||
- OPENCODE_SERVER_PORT=5551
|
||||
- DATABASE_PATH=/app/data/opencode.db
|
||||
- WORKSPACE_PATH=/workspace
|
||||
@@ -27,7 +27,7 @@ services:
|
||||
- opencode-data:/app/data
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:5001/api/health"]
|
||||
test: ["CMD", "curl", "-f", "http://localhost:5003/api/health"]
|
||||
interval: 30s
|
||||
timeout: 3s
|
||||
retries: 3
|
||||
|
||||
@@ -16,7 +16,7 @@ export default defineConfig({
|
||||
port: 5173,
|
||||
proxy: {
|
||||
"/api": {
|
||||
target: "http://localhost:5001",
|
||||
target: "http://localhost:5003",
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user