Browse Source

Flask Dockerfile attempt

Francesco 11 months ago
parent
commit
d8f13c34d1
2 changed files with 8 additions and 0 deletions
  1. 6 0
      flask_be/Dockerfile
  2. 2 0
      site2/deploy/server_readme.md

+ 6 - 0
flask_be/Dockerfile

@@ -1,3 +1,9 @@
 FROM python:3.11.4-bullseye
 
+COPY . /usr/local/
+RUN ["pip", "install", "waitress"]
+WORKDIR /usr/local/flask_be
+RUN ["pip", "install", "-r", "requirements"]
+CMD ["waitress-serve", "--listen=127.0.0.42:5000", "app:app"]
+
 EXPOSE 5000

+ 2 - 0
site2/deploy/server_readme.md

@@ -14,8 +14,10 @@ SSH:
 - ssh-add PRIVATE_KEY  -->  add the PRIVATE_KEY to the ssh service, so it won't need to be passed each time. Works with scp too
 - ssh -i PRIVATE_KEY user@server  -->  connect to server using PRIVATE_KEY. -i PRIVATE_KEY works for scp too. 
 - ssh-copy-id user@server  -->  can be used to copy the/a public key to the server; probably needs password authentication enabled, check.
+--> it's useful to also check the sshd (ssh daemon) configuration, for instance to enable/disable password login
 
 APACHE:
+Note -- most apache commands are shortcuts to stuff that can be done in other, more direct and "handmade" ways
 - systemctl start/stop/restart/reload apache2
 - a2ensite NOMESITO  -->  apache2 command to add 'site' (configuration file NOMESITO.conf in /etc/apache2/sites-available) to sites-enabled
 - a2enmod proxy  -->  command to enable reverse proxy setup in virtualhost (use together with proxy_http)