Port
This commit is contained in:
+2
-2
@@ -31,9 +31,9 @@ COPY --from=builder /app/.next/static ./.next/static
|
|||||||
|
|
||||||
USER nextjs
|
USER nextjs
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 8588
|
||||||
|
|
||||||
ENV PORT 3000
|
ENV PORT 8588
|
||||||
ENV HOSTNAME "0.0.0.0"
|
ENV HOSTNAME "0.0.0.0"
|
||||||
|
|
||||||
CMD ["node", "server.js"]
|
CMD ["node", "server.js"]
|
||||||
|
|||||||
@@ -28,14 +28,15 @@ npm install
|
|||||||
# Run development server
|
# Run development server
|
||||||
npm run dev
|
npm run dev
|
||||||
|
|
||||||
# Build for production
|
# Build and run production server (port 8588)
|
||||||
npm run build
|
npm run prod
|
||||||
|
|
||||||
# Start production server
|
# Or build once, then start
|
||||||
|
npm run build
|
||||||
npm start
|
npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
The website will be available at [http://localhost:3000](http://localhost:3000).
|
The production server listens on [http://localhost:8588](http://localhost:8588). Development (`npm run dev`) uses port 3000 by default.
|
||||||
|
|
||||||
## Project Structure
|
## Project Structure
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ services:
|
|||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "8588:8588"
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=production
|
- NODE_ENV=production
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|||||||
+2
-1
@@ -5,7 +5,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start -p 8588",
|
||||||
|
"prod": "npm run build && next start -p 8588",
|
||||||
"lint": "eslint ."
|
"lint": "eslint ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
Reference in New Issue
Block a user