Skip to content

Commit

Permalink
Added Dockerfile and nxinx server configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
MertenD committed Aug 29, 2023
1 parent 6ff15b4 commit 38d68a7
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Dockerfile
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"]

14 changes: 14 additions & 0 deletions nginx.conf
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;
}
}

0 comments on commit 38d68a7

Please sign in to comment.