mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
31 files changed
+199
-100
No files matched your search
@@ -0,0 +1,14 @@
|
||||
# Build stage
|
||||
FROM node as build-stage
|
||||
WORKDIR /app
|
||||
COPY app/package.json yarn.lock ./
|
||||
RUN yarn install
|
||||
COPY app .
|
||||
RUN yarn build
|
||||
|
||||
# Production stage
|
||||
FROM nginx:stable-alpine as production-stage
|
||||
COPY --from=build-stage /app/dist /usr/share/nginx/html
|
||||
COPY deployment/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
@@ -0,0 +1,7 @@
|
||||
FROM node
|
||||
|
||||
WORKDIR /app
|
||||
COPY app/package.json yarn.lock ./
|
||||
RUN yarn install --frozen-lockfile
|
||||
COPY app .
|
||||
CMD [ "yarn", "dev:docker", "--host", "0.0.0.0" ]
|
||||
@@ -6,6 +6,7 @@
|
||||
"scripts": {
|
||||
"dev": "API_TARGET=https://odyssey.wancat.cc vite",
|
||||
"dev:local": "vite",
|
||||
"dev:docker": "API_TARGET=http://backend:3000 vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import axios from 'axios'
|
||||
|
||||
const api = axios.create({
|
||||
baseURL: '/api',
|
||||
baseURL: '/api/v1',
|
||||
})
|
||||
|
||||
export default api
|
||||
+1
-2
@@ -7,9 +7,8 @@ export default defineConfig({
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: `${process.env.API_TARGET || 'http://localhost:3000'}/api/v1`,
|
||||
target: process.env.API_TARGET || 'http://localhost:3000',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||
},
|
||||
'/socket.io': {
|
||||
target: process.env.API_TARGET || 'ws://localhost:3000',
|
||||
|
||||
Reference in new issue
Block a user