File tree 4 files changed +64
-1
lines changed
4 files changed +64
-1
lines changed Original file line number Diff line number Diff line change 1
1
venv
2
- fly.toml
3
2
.vscode
4
3
__pycache__
Original file line number Diff line number Diff line change
1
+ # Use an official Python runtime as a parent image
2
+
3
+ FROM python:3.8-slim-buster
4
+
5
+
6
+
7
+ # Set the working directory to /app
8
+ WORKDIR /app
9
+
10
+
11
+
12
+ # Copy the current directory contents into the container at /app
13
+ COPY . /app
14
+
15
+
16
+
17
+ # Install any needed packages specified in requirements.txt
18
+ RUN pip install --trusted-host pypi.python.org -r requirements.txt
19
+
20
+
21
+
22
+ RUN apt-get update && \
23
+ apt-get install -y procps
24
+
25
+
26
+
27
+ # Make port 80 available to the world outside this container
28
+ EXPOSE 80
29
+
30
+
31
+
32
+ # Define environment variable
33
+ ENV NAME World
34
+
35
+
36
+
37
+ # Run app.py when the container launches
38
+ CMD ["python" , "hellofly.py" ]
Original file line number Diff line number Diff line change
1
+ # fly.toml file generated for helloabc on 2023-04-07T10:40:34+08:00
2
+
3
+ app = " helloabc"
4
+ kill_signal = " SIGINT"
5
+ kill_timeout = 5
6
+ primary_region = " nrt"
7
+
8
+ [[services ]]
9
+ protocol = " tcp"
10
+ internal_port = 5000
11
+ processes = [" app" ]
12
+
13
+ [[services .ports ]]
14
+ port = 80
15
+ handlers = [" http" ]
16
+ force_https = true
17
+
18
+ [[services .ports ]]
19
+ port = 443
20
+ handlers = [" tls" , " http" ]
21
+ [services .concurrency ]
22
+ type = " connections"
23
+ hard_limit = 25
24
+ soft_limit = 20
Original file line number Diff line number Diff line change 7
7
def hello (name = None ):
8
8
return render_template ('hello.html' , name = name )
9
9
10
+ if __name__ == '__main__' :
11
+ app .run (host = '0.0.0.0' , port = 5000 )
You can’t perform that action at this time.
0 commit comments