timigogo commited on
Commit
ec4d4bc
·
verified ·
1 Parent(s): b5f2f81

Upload 2 files

Browse files
Files changed (2) hide show
  1. Dockerfile +11 -1
  2. main.py +8 -0
Dockerfile CHANGED
@@ -1 +1,11 @@
1
- FROM ghcr.io/fuwei99/new-api-docker:latest
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9-slim
3
+
4
+ # Set the working directory in the container
5
+ WORKDIR /app
6
+
7
+ # Copy the application code into the container
8
+ COPY main.py .
9
+
10
+ # Run main.py when the container launches
11
+ CMD ["python", "main.py"]
main.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ import os
2
+
3
+ sql_dsn = os.getenv("SQL_DSN")
4
+
5
+ if sql_dsn:
6
+ print(f"The value of SQL_DSN is: {sql_dsn}")
7
+ else:
8
+ print("SQL_DSN environment variable not found.")