Skip to content

Commit

Permalink
Change port 3000 to 5173
Browse files Browse the repository at this point in the history
  • Loading branch information
willybrauner committed Feb 7, 2024
1 parent bf6b13c commit a54b0ec
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/front/.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ HOST=localhost
# fix docker apache port - This value need to be sync with docker compose external port
DOCKER_APACHE_PORT=4321
# docker node port
DOCKER_NODE_PORT=3000
DOCKER_NODE_PORT=5173

### BUILD HTACCESS
# Encrypted password
Expand Down
1 change: 1 addition & 0 deletions apps/front/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ dist-ssr
.cache
vite.config.ts.timestamp*
build-stats.html
tsconfig.tsbuildinfo
2 changes: 1 addition & 1 deletion apps/front/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ htaccessTemplateFilePath: resolve("src/.htaccess")
PROTOCOL=https
```

When you run `npm run dev`, you should see the app running on https://localhost:3000
When you run `npm run dev`, you should see the app running on https://localhost:5173

## Workflow

Expand Down
2 changes: 1 addition & 1 deletion apps/front/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const log = debug("server:server")

const loadEnvVars = loadEnv(process.env.NODE_ENV, process.cwd(), "")
const isProduction = process.env.NODE_ENV === "production"
const port = process.env.DOCKER_NODE_PORT ?? portFinderSync.getPort(3000)
const port = process.env.DOCKER_NODE_PORT ?? portFinderSync.getPort(5173)
const protocol = loadEnvVars.PROTOCOL ?? "http"
const isSSL = protocol === "https"

Expand Down
2 changes: 1 addition & 1 deletion apps/front/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default defineConfig(({ command, mode }: ConfigEnv): UserConfig => {
// In some case, process.env vars are loaded via external service like gitlab-ci
// and must overwrite .env vars loaded by loadEnv()
...process.env,
PORT: `${loadEnvVars.DOCKER_NODE_PORT ?? portFinderSync.getPort(3000)}`,
PORT: `${loadEnvVars.DOCKER_NODE_PORT ?? portFinderSync.getPort(5173)}`,
HOST: loadEnvVars["HOST"] ?? ipAddress,
PROTOCOL: protocol,
COMMAND: command,
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ services:
node:
image: node:18.17.1
ports:
- "${DOCKER_NODE_PORT:-3000}:3000"
- "24678:24678" # vite hot reload port
- "1234:1234" # expose node server for generating pages
- "${DOCKER_NODE_PORT:-5173}:5173" # vite dev server
- "24678:24678" # vite HMR
- "1234:1234" # expose express server for static page generation
volumes:
- "./:/app"
working_dir: /app
Expand Down

0 comments on commit a54b0ec

Please sign in to comment.