This commit is contained in:
parent
4953cf09da
commit
bf275844d2
18
Dockerfile.stg
Normal file
18
Dockerfile.stg
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
FROM node:18.20.4-alpine3.20
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN npm install -g pnpm
|
||||||
|
COPY package*.json .
|
||||||
|
COPY pnpm-lock.yaml .
|
||||||
|
RUN pnpm install --prefer-offline=true --frozen-lockfile=true
|
||||||
|
RUN npm i -g serve
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
ENV NODE_ENV=stg
|
||||||
|
|
||||||
|
RUN pnpm build
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
|
|
||||||
|
CMD [ "serve", "-s", "dist" ]
|
@ -4,7 +4,7 @@ services:
|
|||||||
image: fuware-fe
|
image: fuware-fe
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile.stg
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- 16001:3000
|
- 16001:3000
|
||||||
|
@ -1,15 +1,17 @@
|
|||||||
export const POST_LOGIN = '/api/auth/login'
|
const BASE_URL = ''
|
||||||
export const POST_LOGOUT = '/api/auth/logout'
|
|
||||||
export const POST_REFRESH = '/api/auth/refresh'
|
export const POST_LOGIN = `${BASE_URL}/api/auth/login`
|
||||||
export const GET_USER_PROFILE = '/api/user/me'
|
export const POST_LOGOUT = `${BASE_URL}/api/auth/logout`
|
||||||
export const PUT_UPDATE_USER_PROFILE = '/api/user/update-profile'
|
export const POST_REFRESH = `${BASE_URL}/api/auth/refresh`
|
||||||
|
export const GET_USER_PROFILE = `${BASE_URL}/api/user/me`
|
||||||
|
export const PUT_UPDATE_USER_PROFILE = `${BASE_URL}/api/user/update-profile`
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* House API
|
* House API
|
||||||
*/
|
*/
|
||||||
export const POST_HOUSE_CREATE = '/api/house/create'
|
export const POST_HOUSE_CREATE = `${BASE_URL}/api/house/create`
|
||||||
export const GET_HOUSES_LIST = ({ page, pageSize }) =>
|
export const GET_HOUSES_LIST = ({ page, pageSize }) =>
|
||||||
`/api/house/all?page=${page}&pageSize=${pageSize}`
|
`${BASE_URL}/api/house/all?page=${page}&pageSize=${pageSize}`
|
||||||
export const GET_HOUSE_DETAIL = (id) => `/api/house/${id}`
|
export const GET_HOUSE_DETAIL = (id) => `${BASE_URL}/api/house/${id}`
|
||||||
export const PUT_UPDATE_HOUSE = '/api/house/update'
|
export const PUT_UPDATE_HOUSE = `${BASE_URL}/api/house/update`
|
||||||
export const DEL_DELETE_HOUSE = (id) => `/api/house/delete/${id}`
|
export const DEL_DELETE_HOUSE = (id) => `${BASE_URL}/api/house/delete/${id}`
|
||||||
|
@ -10,44 +10,7 @@ export default defineConfig(({ mode }) => {
|
|||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
const env = loadEnv(mode, process.cwd(), '')
|
const env = loadEnv(mode, process.cwd(), '')
|
||||||
|
|
||||||
// production
|
const config_sv = {
|
||||||
if (env.NODE_ENV === 'production') {
|
|
||||||
return {
|
|
||||||
resolve: {
|
|
||||||
alias: {
|
|
||||||
'@': path.resolve(_dirname, './src'),
|
|
||||||
'@lang': path.resolve(_dirname, './src/lang'),
|
|
||||||
'@api': path.resolve(_dirname, './src/api'),
|
|
||||||
'@hooks': path.resolve(_dirname, './src/hooks'),
|
|
||||||
'@pages': path.resolve(_dirname, './src/pages'),
|
|
||||||
'@components': path.resolve(_dirname, './src/components'),
|
|
||||||
'@routes': path.resolve(_dirname, './src/routes'),
|
|
||||||
'@utils': path.resolve(_dirname, './src/utils'),
|
|
||||||
'@assets': path.resolve(_dirname, './src/assets'),
|
|
||||||
'@context': path.resolve(_dirname, './src/context'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
plugins: [react()],
|
|
||||||
css: {
|
|
||||||
preprocessorOptions: {
|
|
||||||
scss: {
|
|
||||||
additionalData: '@import "./src/_mantine";',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
server: {
|
|
||||||
https: false,
|
|
||||||
host: false,
|
|
||||||
port: 5001,
|
|
||||||
strictPort: true,
|
|
||||||
watch: {
|
|
||||||
usePolling: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': path.resolve(_dirname, './src'),
|
'@': path.resolve(_dirname, './src'),
|
||||||
@ -70,6 +33,44 @@ export default defineConfig(({ mode }) => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// production
|
||||||
|
if (env.NODE_ENV === 'production') {
|
||||||
|
return {
|
||||||
|
...config_sv,
|
||||||
|
server: {
|
||||||
|
https: false,
|
||||||
|
host: false,
|
||||||
|
port: 5001,
|
||||||
|
strictPort: true,
|
||||||
|
watch: {
|
||||||
|
usePolling: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (env.NODE_ENV === 'stg') {
|
||||||
|
return {
|
||||||
|
...config_sv,
|
||||||
|
server: {
|
||||||
|
https: false,
|
||||||
|
host: false,
|
||||||
|
port: 5001,
|
||||||
|
strictPort: true,
|
||||||
|
watch: {
|
||||||
|
usePolling: true,
|
||||||
|
},
|
||||||
|
proxy: {
|
||||||
|
'/api': 'https://stg-be.samliu.io.vn',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
...config_sv,
|
||||||
server: {
|
server: {
|
||||||
https: false,
|
https: false,
|
||||||
host: true,
|
host: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user