1+ import {
2+ CreateApplicationRolloutRequest ,
3+ InstanceType ,
4+ SchedulingPolicy ,
5+ } from "./client" ;
6+
17export interface Logger {
28 debug : ( message : string ) => void ;
39 log : ( message : string ) => void ;
@@ -20,6 +26,30 @@ export type BuildArgs = {
2026 setNetworkToHost ?: boolean ;
2127} ;
2228
29+ export type ContainerNormalisedConfig = RegistryLinkConfig | DockerfileConfig ;
30+ export type DockerfileConfig = SharedContainerConfig & {
31+ /** absolute path, resolved relative to the wrangler config file */
32+ dockerfile : string ;
33+ /** absolute path, resolved relative to the wrangler config file. defaults to the directory of the dockerfile */
34+ image_build_context : string ;
35+ image_vars ?: Record < string , string > ;
36+ } ;
37+ export type RegistryLinkConfig = SharedContainerConfig & {
38+ registry_link : string ;
39+ } ;
40+
41+ export type InstanceTypeOrLimits =
42+ | {
43+ /** if undefined in config, defaults to instance_type */
44+ disk_size ?: number ;
45+ vcpu ?: number ;
46+ memory_mib ?: number ;
47+ }
48+ | {
49+ /** if undefined in config, defaults to "dev" */
50+ instance_type : InstanceType ;
51+ } ;
52+
2353/** build/pull agnostic container options */
2454export type ContainerDevOptions = {
2555 /** may be dockerfile or registry link */
@@ -32,3 +62,26 @@ export type ContainerDevOptions = {
3262 /** build time args */
3363 args ?: Record < string , string > ;
3464} ;
65+
66+ /**
67+ * Shared container config that is used regardless of whether the image is from a dockerfile or a registry link.
68+ */
69+ export type SharedContainerConfig = {
70+ /** if undefined in config, defaults to worker_name[-envName]-class_name. */
71+ name : string ;
72+ /** container's DO class name */
73+ class_name : string ;
74+ /** if undefined in config, defaults to 0 */
75+ max_instances : number ;
76+ /** if undefined in config, defaults to "default" */
77+ scheduling_policy : SchedulingPolicy ;
78+ /** if undefined in config, defaults to 25 */
79+ rollout_step_percentage : number ;
80+ /** if undefined in config, defaults to "full_auto" */
81+ rollout_kind : "full_auto" | "full_manual" | "none" ;
82+ constraints ?: {
83+ regions ?: string [ ] ;
84+ cities ?: string [ ] ;
85+ tier ?: number ;
86+ } ;
87+ } & InstanceTypeOrLimits ;
0 commit comments