-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Dockerfile and nxinx server configuration
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Setzen Sie das Basis-Image | ||
FROM node:16-alpine | ||
|
||
# Setzen Sie das Arbeitsverzeichnis | ||
WORKDIR /app | ||
|
||
# Kopieren Sie die Datei package.json (und die dazugehörige package-lock.json, falls vorhanden) | ||
COPY package*.json ./ | ||
|
||
# Installieren Sie alle Abhängigkeiten | ||
RUN npm install | ||
|
||
# Kopieren Sie den Rest des Anwendungsquellcodes | ||
COPY . . | ||
|
||
# Bauen Sie Ihre Next.js-Anwendung | ||
RUN npm install && npm run build | ||
|
||
# Exponieren Sie den Port für den Next.js-Server (standardmäßig 3000) | ||
EXPOSE 3002 | ||
|
||
# Führen Sie den Next.js-Server aus | ||
CMD ["npm", "start"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
server { | ||
listen 3002; | ||
server_name localhost; | ||
|
||
location / { | ||
proxy_pass http://localhost:3002; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection 'upgrade'; | ||
proxy_set_header Host $host; | ||
proxy_cache_bypass $http_upgrade; | ||
} | ||
} | ||
|