Skip to content

Commit 498a00e

Browse files
committed
Fix issues with taken ports
1 parent 70ce311 commit 498a00e

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

.diploi/helm/app.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ spec:
5858
- containerPort: 8000
5959
{{- if eq .Values.stage "development" }}
6060
command: ["/usr/bin/nodemon"]
61-
args: ["--exec", "/app/{{ .Values.identifier }}/.venv/bin/python", "src/main.py"]
61+
args: ["--delay", "1", "--exec", "/app/{{ .Values.identifier }}/.venv/bin/python", "src/main.py"]
6262
workingDir: /app/{{ .Values.identifier }}
6363
{{- end }}
6464
env:

Dockerfile.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ EXPOSE 8000
2525
ENV PORT=8000
2626
ENV HOST="0.0.0.0"
2727

28-
CMD ["/usr/bin/nodemon", "--exec", ".venv/bin/python", "src/main.py"]
28+
CMD ["/usr/bin/nodemon", "--delay", "1", "--exec", ".venv/bin/python", "src/main.py"]

src/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ def do_GET(self):
1111
self.end_headers()
1212
self.wfile.write(response.encode('utf-8'))
1313

14+
class Server(socketserver.TCPServer):
15+
allow_reuse_address = True
1416

15-
httpd = socketserver.TCPServer(('0.0.0.0', 8000), Handler)
17+
httpd = Server(('0.0.0.0', 8000), Handler)
1618
httpd.serve_forever()

0 commit comments

Comments
 (0)