Hi, thanks for great tool! Trying to customise build configuration, but found some issues and i need some help.
Use cases
- Build monorepo with nextjs
- Respository structure is classic for turborepo
- Have several apps to build with docker and deploy with serverless container
Build config
name: example
deployment:
type: awsApi@1.0
containers:
example-docs:
src: ./apps/example-docs
routing:
domain: dev-docs.example.com
pathPattern: /*
pathHealthCheck: /api/health
environment:
HELLO: world
compute:
type: awsFargateEcs
example-web:
src: ./apps/example-web
compute:
type: awsFargateEcs
awsFargateEcs:
cpu: 256
memory: 512
build:
args: # Optional: Arguments to pass to the build, as a map of key-value pairs. This is useful for passing in build arguments to the Dockerfile, like ssh keys to fetch private dependencies, etc.
key: value # Example: ARG key=value
dockerFileString: ./apps/example-web/Dockerfile
routing:
domain: dev-web.example.com
pathPattern: /*
pathHealthCheck: /api/health
environment:
HELLO: world
Build error
When i try to deploy this config - it errors with on serverless deploy
- Unrecognized key(s): build
{
"source": "sfcore.analysis.generated.v1",
"event": {
"actionSucceeded": false,
"operatingSystem": "linux",
"architecture": "x64",
"cicd": true,
...
"isCompose": false,
"projectType": "containers",
"cliOptions": [
"stage",
"debug"
],
"source": "serverless@4.6.2",
"actionName": "deploy",
"configurationFileName": "serverless.containers.yml",
"resolvers": [],
"error": {
"name": "Error",
"message": "Invalid configuration:\n\n - Unrecognized key(s): build\n\n",
"code": "INVALID_CONFIGURATION"
}
}
}
Build error analysis
containers:
my-container:
src: ./path/to/container # Required: Path to the container source code.
compute: # Required: Compute configuration.
build: # Optional: Build configuration.
environment: # Optional: Environment variables to pass to the container.
routing: # Required: Routing configuration.
dev: # Optional: Development mode configuration
example-web:
src: ./apps/example-web
compute:
build:
args: # Optional: Arguments to pass to the build, as a map of key-value pairs. This is useful for passing in build arguments to the Dockerfile, like ssh keys to fetch private dependencies, etc.
key: value # Example: ARG key=value
dockerFileString: ./apps/example-web/Dockerfile
- Could not find source code to check - is it opensoured?
- Main hypothesis - looks like a bug 🐛
Docker examples?
More bugs?
- hypothesis that
dockerFileString -> supposed to be dockerFile as is see in serverless configuration
Proposual for configuration update
Add build context to separate src and context
- Why? Monorepo use cases - all build made from root build context.
build:
args: # Optional: Arguments to pass to the build, as a map of key-value pairs. This is useful for passing in build arguments to the Dockerfile, like ssh keys to fetch private dependencies, etc.
key: value # Example: ARG key=value
dockerFileString: # Optional: Dockerfile as a string to use for the container (not recommended, prefer
context: # Optional: Build context for docker file```
Hi, thanks for great tool! Trying to customise build configuration, but found some issues and i need some help.
Use cases
Build config
Build error
When i try to deploy this config - it errors with on
serverless deployBuild error analysis
Docker examples?
More bugs?
dockerFileString-> supposed to bedockerFileas is see in serverless configurationProposual for configuration update
src: ./path/to/container- Path to the container source code and mainly build context for Dockerfilecontext: .- build context for docker fileAdd build context to separate src and context
Would be great to add build context for Dockerfile.
Example: