feat: Make dockerfile path optional and default to "Dockerfile"

This commit is contained in:
Jiří Vrba
2026-02-20 09:19:20 +01:00
parent 3e461f642e
commit 5d3e05536e
2 changed files with 4 additions and 8 deletions
@@ -74,12 +74,7 @@ const buildTypeDisplayMap: Record<BuildType, string> = {
const mySchema = z.discriminatedUnion("buildType", [ const mySchema = z.discriminatedUnion("buildType", [
z.object({ z.object({
buildType: z.literal(BuildType.dockerfile), buildType: z.literal(BuildType.dockerfile),
dockerfile: z dockerfile: z.string().nullable().default(""),
.string({
required_error: "Dockerfile path is required",
invalid_type_error: "Dockerfile path is required",
})
.min(1, "Dockerfile required"),
dockerContextPath: z.string().nullable().default(""), dockerContextPath: z.string().nullable().default(""),
dockerBuildStage: z.string().nullable().default(""), dockerBuildStage: z.string().nullable().default(""),
}), }),
@@ -347,9 +342,10 @@ export const ShowBuildChooseForm = ({ applicationId }: Props) => {
<FormLabel>Docker File</FormLabel> <FormLabel>Docker File</FormLabel>
<FormControl> <FormControl>
<Input <Input
placeholder="Path of your docker file" placeholder="Path of your docker file (default: Dockerfile)"
{...field} {...field}
value={field.value ?? ""} value={field.value ?? ""}
defaultValue={"Dockerfile"}
/> />
</FormControl> </FormControl>
<FormMessage /> <FormMessage />
@@ -127,7 +127,7 @@ export const getBuildAppDirectory = (application: Application) => {
appName, appName,
"code", "code",
buildPath ?? "", buildPath ?? "",
dockerfile || "", dockerfile || "Dockerfile",
); );
} }