Change dev/prod ones

This commit is contained in:
Matt DiMeglio 2025-06-11 16:49:54 -04:00
parent fafce681ed
commit 7153472ddf
4 changed files with 55 additions and 21 deletions

View file

@ -1,11 +1,11 @@
{ {
"name": "shiftsync-website", "name": "shiftsync-website",
"private": true, "private": true,
"version": "1.0.1", "version": "0.0.0",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"api": "npm run dev --prefix api", "api": "npm run dev --prefix api",
"web": "npm run dev --prefix web", "web": "npm run local --prefix web",
"dev": "concurrently \"npm run api\" \"npm run web\"", "dev": "concurrently \"npm run api\" \"npm run web\"",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },

15
web/Dockerfile.prod Normal file
View file

@ -0,0 +1,15 @@
FROM node:20-alpine
WORKDIR /app
COPY ./package*.json ./
RUN npm ci
COPY . ./
EXPOSE 5173
EXPOSE 5171
CMD ["npm", "run", "prod"]

View file

@ -1,10 +1,12 @@
{ {
"name": "shiftsync-website-web", "name": "shiftsync-website-web",
"private": true, "private": true,
"version": "1.0.0", "version": "1.0.1",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite --host", "local": "vite",
"dev": "vite --host --mode dev",
"prod": "vite --host --mode prod",
"build": "vite build", "build": "vite build",
"lint": "eslint .", "lint": "eslint .",
"preview": "vite preview" "preview": "vite preview"

View file

@ -3,22 +3,39 @@ import react from '@vitejs/plugin-react';
import path from 'path'; import path from 'path';
// https://vite.dev/config/ // https://vite.dev/config/
export default defineConfig({ export default defineConfig(({ mode = 'local' }) => {
plugins: [react()], const isDev = mode === 'dev';
server:{ const isProd = mode === 'prod';
host: true,
allowedHosts: ['.code-catalyst.com'], return {
cors: true, plugins: [react()],
hmr: { server:{
protocol: 'wss', host: true,
host: ['*.code-catalyst.com'], allowedHosts: ['.code-catalyst.com'],
clientPort: 443, cors: true,
} hmr: isDev
}, ? {
resolve: { protocol: 'wss',
alias: { host: 'shift-dev.code-catalyst.com',
'@src': path.resolve(__dirname, 'src'), clientPort: 443,
'@components': path.resolve(__dirname, 'components') }
: isProd ?
{
protocol: 'wss',
host: 'shift.code-catalyst.com',
clientPort: 443,
}
: {
protocol: 'wss',
host: 'localhost',
clientPort: 443,
},
}, },
}, resolve: {
alias: {
'@src': path.resolve(__dirname, 'src'),
'@components': path.resolve(__dirname, 'components')
},
},
}
}); });