SlangLab-NU / VoiceCollector

Apache License 2.0
1 stars 0 forks source link

Create dockerfile #25

Closed macarious closed 1 year ago

macarious commented 1 year ago

Closes #5 Three Docker Files are created in the root directory (along with the configuration files):

  1. Dockerfile.minio for the MinIO storage,
  2. Dockerfile.server for the backend API, and
  3. Dockerfile.web for the frontend application.

Instructions to build and run the containers are found in DOCKER_README.md.

The web application has been tested by submitting a voice sample to the MinIO server through the backend API to ensure the three containers are communicating properly.

The voice sample has been successfully submitted: web-voice-submitted

The voice sample has been saved successfully in the MinIO container: minio-container-local-s3

The log shows that the backend API server is being called and requests are resolved properly:

2023-08-25 12:15:28 minio-container   | Formatting 1st pool, 1 set(s), 1 drives per set.
2023-08-25 12:15:28 server-container  |  * Serving Flask app '__init__.py'
2023-08-25 12:15:28 minio-container   | WARNING: Host local has more than 0 drives of set. A host failure will result in data becoming unavailable.
2023-08-25 12:15:28 server-container  |  * Debug mode: off
2023-08-25 12:15:28 minio-container   | MinIO Object Storage Server
2023-08-25 12:15:28 server-container  | Level: INFO
2023-08-25 12:15:28 minio-container   | Copyright: 2015-2023 MinIO, Inc.
2023-08-25 12:15:28 server-container  | Time: 2023-08-25 19:15:28,960
2023-08-25 12:15:28 server-container  | Logger: werkzeug
2023-08-25 12:15:28 server-container  | Path: _internal:224
2023-08-25 12:15:28 server-container  | Function :_log
2023-08-25 12:15:28 minio-container   | License: GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>
2023-08-25 12:15:28 server-container  | Message: WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
2023-08-25 12:15:28 minio-container   | Version: RELEASE.2023-08-16T20-17-30Z (go1.19.12 linux/amd64)
2023-08-25 12:15:28 server-container  |  * Running on all addresses (0.0.0.0)
2023-08-25 12:15:28 server-container  |  * Running on http://127.0.0.1:5000
2023-08-25 12:15:28 server-container  |  * Running on http://172.19.0.3:5000
2023-08-25 12:15:28 server-container  | 
2023-08-25 12:15:28 server-container  | Level: INFO
2023-08-25 12:15:28 server-container  | Time: 2023-08-25 19:15:28,960
2023-08-25 12:15:28 server-container  | Logger: werkzeug
2023-08-25 12:15:28 minio-container   | 
2023-08-25 12:15:28 minio-container   | Status:         1 Online, 0 Offline. 
2023-08-25 12:15:28 server-container  | Path: _internal:224
2023-08-25 12:15:28 server-container  | Function :_log
2023-08-25 12:15:28 server-container  | Message: Press CTRL+C to quit
2023-08-25 12:15:28 server-container  | 
2023-08-25 12:15:31 server-container  | Level: INFO
2023-08-25 12:15:31 server-container  | Time: 2023-08-25 19:15:31,793
2023-08-25 12:15:31 server-container  | Logger: werkzeug
2023-08-25 12:15:31 server-container  | Path: _internal:224
2023-08-25 12:15:31 server-container  | Function :_log
2023-08-25 12:15:31 server-container  | Message: 172.19.0.2 - - [25/Aug/2023 19:15:31] "GET /api/v1/speak/get_reference HTTP/1.0" 200 -
2023-08-25 12:15:31 server-container  | 
2023-08-25 12:15:59 server-container  | Level: INFO
2023-08-25 12:15:59 server-container  | Time: 2023-08-25 19:15:59,986
2023-08-25 12:15:59 server-container  | Logger: speak
2023-08-25 12:15:59 server-container  | Path: length_check:9
2023-08-25 12:15:59 server-container  | Function :get_audio_length
2023-08-25 12:15:59 server-container  | Message: duration (s): 1.92
2023-08-25 12:15:59 server-container  | 
2023-08-25 12:15:59 server-container  | 000000000000000000000001111111111+(0.6900000000000004)111111111111111111111111111111-(1.8900000000000015)
2023-08-25 12:15:59 server-container  | Level: INFO
2023-08-25 12:15:59 server-container  | Time: 2023-08-25 19:15:59,988
2023-08-25 12:15:59 server-container  | Logger: speak
2023-08-25 12:15:59 server-container  | Path: silence_check:165
2023-08-25 12:15:28 minio-container   | S3-API: http://172.19.0.4:9000  http://127.0.0.1:9000 
2023-08-25 12:15:28 minio-container   | Console: http://172.19.0.4:35701 http://127.0.0.1:35701 
2023-08-25 12:15:28 minio-container   | 
2023-08-25 12:15:28 minio-container   | Documentation: https://min.io/docs/minio/linux/index.html
2023-08-25 12:15:59 server-container  | Function :get_silence_ratio
2023-08-25 12:15:59 server-container  | Message: Voiced frames count: 40
2023-08-25 12:15:59 server-container  | 
2023-08-25 12:15:59 server-container  | Level: INFO
2023-08-25 12:15:59 server-container  | Time: 2023-08-25 19:15:59,988
2023-08-25 12:15:59 server-container  | Logger: speak
2023-08-25 12:15:59 server-container  | Path: silence_check:166
2023-08-25 12:15:28 minio-container   | Warning: The standard parity is set to 0. This can lead to data loss.
2023-08-25 12:15:59 server-container  | Function :get_silence_ratio
2023-08-25 12:15:28 minio-container   | 
2023-08-25 12:15:59 server-container  | Message: Total frames count: 63
2023-08-25 12:15:28 minio-container   |  You are running an older version of MinIO released 6 days before the latest release 
2023-08-25 12:15:59 server-container  | 
2023-08-25 12:15:28 minio-container   |  Update: Run `mc admin update` 
2023-08-25 12:15:59 server-container  | Level: INFO
2023-08-25 12:15:28 minio-container   | 
2023-08-25 12:15:59 server-container  | Time: 2023-08-25 19:15:59,988
2023-08-25 12:15:28 web-container     | 2023/08/25 19:15:28 [notice] 1#1: using the "epoll" event method
2023-08-25 12:15:28 web-container     | 2023/08/25 19:15:28 [notice] 1#1: nginx/1.24.0
2023-08-25 12:15:28 minio-container   | 
2023-08-25 12:15:30 minio-container   | MinIO server is ready!
2023-08-25 12:15:59 server-container  | Logger: speak
2023-08-25 12:15:30 minio-container   | Added `myminio` successfully.
2023-08-25 12:15:59 server-container  | Path: silence_check:168
2023-08-25 12:15:28 web-container     | 2023/08/25 19:15:28 [notice] 1#1: built by gcc 12.2.1 20220924 (Alpine 12.2.1_git20220924-r4) 
2023-08-25 12:15:30 minio-container   | Bucket created successfully `myminio/local-s3`.
2023-08-25 12:15:28 web-container     | 2023/08/25 19:15:28 [notice] 1#1: OS: Linux 5.15.90.1-microsoft-standard-WSL2
2023-08-25 12:15:59 server-container  | Function :get_silence_ratio
2023-08-25 12:15:59 server-container  | Message: Silence ratio: 0.37
2023-08-25 12:15:59 server-container  | 
2023-08-25 12:16:00 server-container  | Level: INFO
2023-08-25 12:15:28 web-container     | 2023/08/25 19:15:28 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2023-08-25 12:15:28 web-container     | 2023/08/25 19:15:28 [notice] 1#1: start worker processes
2023-08-25 12:16:00 server-container  | Time: 2023-08-25 19:16:00,019
2023-08-25 12:16:00 server-container  | Logger: werkzeug
2023-08-25 12:16:00 server-container  | Path: _internal:224
2023-08-25 12:16:00 server-container  | Function :_log
2023-08-25 12:15:28 web-container     | 2023/08/25 19:15:28 [notice] 1#1: start worker process 7
2023-08-25 12:16:00 server-container  | Message: 172.19.0.2 - - [25/Aug/2023 19:16:00] "POST /api/v1/speak/submit/test27.280904543172802.webm HTTP/1.0" 200 -
2023-08-25 12:16:00 server-container  | 
2023-08-25 12:15:28 web-container     | 2023/08/25 19:15:28 [notice] 1#1: start worker process 8
2023-08-25 12:15:28 web-container     | 2023/08/25 19:15:28 [notice] 1#1: start worker process 9
2023-08-25 12:15:28 web-container     | 2023/08/25 19:15:28 [notice] 1#1: start worker process 10
2023-08-25 12:15:28 web-container     | 2023/08/25 19:15:28 [notice] 1#1: start worker process 11
2023-08-25 12:15:28 web-container     | 2023/08/25 19:15:28 [notice] 1#1: start worker process 12
2023-08-25 12:15:28 web-container     | 2023/08/25 19:15:28 [notice] 1#1: start worker process 13
2023-08-25 12:15:28 web-container     | 2023/08/25 19:15:28 [notice] 1#1: start worker process 14
2023-08-25 12:15:28 web-container     | 2023/08/25 19:15:28 [notice] 1#1: start worker process 15
2023-08-25 12:15:28 web-container     | 2023/08/25 19:15:28 [notice] 1#1: start worker process 16
2023-08-25 12:15:28 web-container     | 2023/08/25 19:15:28 [notice] 1#1: start worker process 17
2023-08-25 12:15:28 web-container     | 2023/08/25 19:15:28 [notice] 1#1: start worker process 18
2023-08-25 12:15:31 web-container     | 172.19.0.1 - - [25/Aug/2023:19:15:31 +0000] "GET /record HTTP/1.1" 200 644 "http://localhost:3000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.0.0" "-"
2023-08-25 12:15:31 web-container     | 172.19.0.1 - - [25/Aug/2023:19:15:31 +0000] "GET /static/js/main.cb39f5c4.js HTTP/1.1" 200 556940 "http://localhost:3000/record" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.0.0" "-"
2023-08-25 12:15:31 web-container     | 172.19.0.1 - - [25/Aug/2023:19:15:31 +0000] "GET /static/css/main.6dcb3716.css HTTP/1.1" 200 1532 "http://localhost:3000/record" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.0.0" "-"
2023-08-25 12:15:31 web-container     | 172.19.0.1 - - [25/Aug/2023:19:15:31 +0000] "GET /static/css/main.6dcb3716.css.map HTTP/1.1" 200 2647 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.0.0" "-"
2023-08-25 12:15:31 web-container     | 172.19.0.1 - - [25/Aug/2023:19:15:31 +0000] "GET /static/js/main.cb39f5c4.js.map HTTP/1.1" 200 2445303 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.0.0" "-"
2023-08-25 12:15:31 web-container     | 172.19.0.1 - - [25/Aug/2023:19:15:31 +0000] "GET /favicon.ico HTTP/1.1" 200 3870 "http://localhost:3000/record" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.0.0" "-"
2023-08-25 12:15:31 web-container     | 172.19.0.1 - - [25/Aug/2023:19:15:31 +0000] "GET /api/v1/speak/get_reference HTTP/1.1" 200 2760 "http://localhost:3000/record" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.0.0" "-"
2023-08-25 12:15:31 web-container     | 172.19.0.1 - - [25/Aug/2023:19:15:31 +0000] "GET /manifest.json HTTP/1.1" 200 517 "http://localhost:3000/record" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.0.0" "-"
2023-08-25 12:15:31 web-container     | 172.19.0.1 - - [25/Aug/2023:19:15:31 +0000] "GET /logo192.png HTTP/1.1" 200 5347 "http://localhost:3000/record" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.0.0" "-"
2023-08-25 12:15:59 web-container     | 2023/08/25 19:15:59 [warn] 10#10: *5 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000001, client: 172.19.0.1, server: localhost, request: "POST /api/v1/speak/submit/test27.280904543172802.webm HTTP/1.1", host: "localhost:3000", referrer: "http://localhost:3000/record"
2023-08-25 12:16:00 web-container     | 172.19.0.1 - - [25/Aug/2023:19:16:00 +0000] "POST /api/v1/speak/submit/test27.280904543172802.webm HTTP/1.1" 200 35 "http://localhost:3000/record" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.0.0" "-"