ianluo commited on
Commit
497b153
β€’
1 Parent(s): 8fc9dd0

restructure

Browse files
Files changed (4) hide show
  1. Dockerfile +5 -0
  2. main.py β†’ app/main.py +0 -0
  3. flake.lock +61 -0
  4. flake.nix +31 -0
Dockerfile CHANGED
@@ -1,6 +1,11 @@
1
  FROM python:3.9
 
2
  WORkDIR /code
 
3
  COPY ./requirements.txt /code/requirements.txt
 
4
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
5
  COPY . .
 
6
  CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.9
2
+
3
  WORkDIR /code
4
+
5
  COPY ./requirements.txt /code/requirements.txt
6
+
7
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
+
9
  COPY . .
10
+
11
  CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
main.py β†’ app/main.py RENAMED
File without changes
flake.lock ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "nodes": {
3
+ "flake-utils": {
4
+ "inputs": {
5
+ "systems": "systems"
6
+ },
7
+ "locked": {
8
+ "lastModified": 1681202837,
9
+ "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
10
+ "owner": "numtide",
11
+ "repo": "flake-utils",
12
+ "rev": "cfacdce06f30d2b68473a46042957675eebb3401",
13
+ "type": "github"
14
+ },
15
+ "original": {
16
+ "owner": "numtide",
17
+ "repo": "flake-utils",
18
+ "type": "github"
19
+ }
20
+ },
21
+ "nixpkgs": {
22
+ "locked": {
23
+ "lastModified": 1683408522,
24
+ "narHash": "sha256-9kcPh6Uxo17a3kK3XCHhcWiV1Yu1kYj22RHiymUhMkU=",
25
+ "owner": "NixOS",
26
+ "repo": "nixpkgs",
27
+ "rev": "897876e4c484f1e8f92009fd11b7d988a121a4e7",
28
+ "type": "github"
29
+ },
30
+ "original": {
31
+ "owner": "NixOS",
32
+ "ref": "nixos-unstable",
33
+ "repo": "nixpkgs",
34
+ "type": "github"
35
+ }
36
+ },
37
+ "root": {
38
+ "inputs": {
39
+ "flake-utils": "flake-utils",
40
+ "nixpkgs": "nixpkgs"
41
+ }
42
+ },
43
+ "systems": {
44
+ "locked": {
45
+ "lastModified": 1681028828,
46
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
47
+ "owner": "nix-systems",
48
+ "repo": "default",
49
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
50
+ "type": "github"
51
+ },
52
+ "original": {
53
+ "owner": "nix-systems",
54
+ "repo": "default",
55
+ "type": "github"
56
+ }
57
+ }
58
+ },
59
+ "root": "root",
60
+ "version": 7
61
+ }
flake.nix ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ description = "A very basic flake";
3
+
4
+ inputs = {
5
+ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6
+ nixpkgs.inputs.nixpkgs.follows = "nixpkgs";
7
+ flake-utils.url = "github:numtide/flake-utils";
8
+ };
9
+
10
+ outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system:
11
+ let
12
+ pkgs = import nixpkgs {
13
+ inherit system;
14
+ };
15
+ pythonPackages = pkgs.python39Packages;
16
+ runPackages = with nixpkgs; [
17
+ pythonPackages.python
18
+ ];
19
+ devPackages = with nixpkgs; runPackages ++ [
20
+ pythonPackages.pip
21
+ ];
22
+ in
23
+ {
24
+ devShell = with pkgs; mkShell {
25
+ buildInputs = [
26
+ devPackages
27
+ ];
28
+ };
29
+ }
30
+ );
31
+ }