👨‍💻 Studentbox documentation

Search

Search IconIcon to open search

2023-05-08

Last updated May 8, 2023 Edit Source

I’ve found a simple solution for my problem the other day: I’m publishing port 80 for the pod, so we just need one container listening to port 80 within the pod. Because Apache (for the LAMP runtime) is already listening to this port, it shouldn’t be a problem.

It’s working! with studentbox spawn -u sinux -p firstproject -r lamp, it creates a directory in ./data/sinux/firstproject/ for my project, containing my two mountpoints: db for MariaDB data, and html for my php code. I used my example, changing the values for the connection to the database (for now, I retrieve the password and port with podman inspect), and my example works:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
$ curl http://localhost:38231 -v 
*   Trying 127.0.0.1:38231...
* Connected to localhost (127.0.0.1) port 38231 (#0)
> GET / HTTP/1.1
> Host: localhost:38231
> User-Agent: curl/8.0.1
> Accept: */*
> 
< HTTP/1.1 200 OK
< Date: Mon, 08 May 2023 19:29:14 GMT
< Server: Apache/2.4.55 (Unix)
< X-Powered-By: PHP/8.2.3
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=UTF-8
< 
Today is 2023-05-08
Connected to MySQL
Databases:
app
information_schema
* Connection #0 to host localhost left intact

Because I don’t have enough time, the CLI will have to be used server-side. This change the way we interact with the system, and more configuration will be required. However, it should still simplify the teacher’s job, as it automatically spawn an runtime, mount required directories etc. I’ll have to include standard command command to retrieve variables, listing runtimes, student’s projects… Maybe also limit a pod’s memory