sst / ion

Moved to https://github.com/sst/sst
https://github.com/sst/sst
MIT License
2.13k stars 243 forks source link

Feat: add copyFiles for container python functions #1134

Closed spoeck closed 1 month ago

spoeck commented 1 month ago

If you define following python function in your sst.config.ts, the copyFiles are missing in the built container:

 const python = new sst.aws.Function("MyPythonFunction", {
      handler: "backend/python.handler",
      runtime: "python3.11", 
      url: true,
      copyFiles: [
        {
          from: "backend/src/mymodule.py",
          to: "backend/src/mymodule.py",
        },
        {
          from: "backend/src",
          to: "src",
        },
        {
          from: "backend/data/sample.csv",
          to: "sample.csv",
        },
      ],
      python: {
        container: true,
      },
    });

Now we copy the files defined in copyFiles into the root folder which the Dockerfile later on copies and build the python container with it.

spoeck commented 1 month ago

This problem was fixed with #1091 by @walln I close my PR