Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions mrunner/runner_deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,18 @@ func (r *Runner) createDatabaseContainer(ctx context.Context, dbType mconfig.Pla
Mounts: mounts,
}

// Check if an environment variable is set for the postgres image
postgresImage := os.Getenv("MAGIC_POSTGRES_IMAGE")
if postgresImage == "" {
postgresImage = "postgres:latest"
}

// Create the container
resp, err := r.client.ContainerCreate(ctx, &container.Config{
Image: "postgres:latest",
Image: postgresImage,
Env: []string{
fmt.Sprintf("POSTGRES_PASSWORD=%s", mconfig.DefaultPassword(dbType.Type)),
fmt.Sprintf("POSTGRES_USERNAME=%s", mconfig.DefaultUsername(dbType.Type)),
fmt.Sprintf("POSTGRES_USER=%s", mconfig.DefaultUsername(dbType.Type)),
"POSTGRES_DATABASE=postgres",
},
ExposedPorts: exposedPorts,
Expand Down