Skip to content
Merged
Show file tree
Hide file tree
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
15 changes: 15 additions & 0 deletions docker-compose.http-only.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ services:
volumes:
- ${DOCKER_SOCKET:-/var/run/docker.sock}:/var/run/docker.sock:ro
restart: unless-stopped
labels:
- org.dyrectorio.service-category=_internal
crux:
container_name: crux
image: ghcr.io/dyrector-io/dyrectorio/web/crux:${DYO_VERSION:-stable}
Expand Down Expand Up @@ -57,6 +59,7 @@ services:
- traefik.http.routers.crux-http.entrypoints=web
- traefik.http.routers.crux-http.service=crux-http
- traefik.http.services.crux-http.loadbalancer.server.port=1848
- org.dyrectorio.service-category=_internal
# ports:
# - 1848:1848 # http API
crux-migrate:
Expand All @@ -70,6 +73,8 @@ services:
crux-postgres:
condition: service_healthy
restart: 'no'
labels:
- org.dyrectorio.service-category=_internal
crux-postgres:
container_name: crux-postgres
image: docker.io/library/postgres:13-alpine
Expand All @@ -84,6 +89,8 @@ services:
interval: 5s
timeout: 5s
retries: 5
labels:
- org.dyrectorio.service-category=_internal
crux-ui:
container_name: crux-ui
image: ghcr.io/dyrector-io/dyrectorio/web/crux-ui:${DYO_VERSION:-stable}
Expand All @@ -108,6 +115,7 @@ services:
- traefik.http.routers.crux-ui.rule=Host(`${DOMAIN}`)
- traefik.http.routers.crux-ui.entrypoints=web
- traefik.http.services.crux-ui.loadbalancer.server.port=3000
- org.dyrectorio.service-category=_internal
kratos:
container_name: kratos
image: ghcr.io/dyrector-io/dyrectorio/web/kratos:${DYO_VERSION:-stable}
Expand Down Expand Up @@ -146,6 +154,7 @@ services:
- traefik.http.middlewares.kratos-strip.stripprefix.prefixes=/kratos
- traefik.http.middlewares.kratos-ratelimit.ratelimit.average=100
- traefik.http.routers.kratos.middlewares=kratos-strip,kratos-ratelimit
- org.dyrectorio.service-category=_internal
kratos-migrate:
container_name: kratos-migrate
image: ghcr.io/dyrector-io/dyrectorio/web/kratos:${DYO_VERSION:-stable}
Expand All @@ -157,6 +166,8 @@ services:
kratos-postgres:
condition: service_healthy
restart: 'no'
labels:
- org.dyrectorio.service-category=_internal
kratos-postgres:
container_name: kratos-postgres
image: docker.io/library/postgres:13-alpine
Expand All @@ -171,6 +182,8 @@ services:
interval: 5s
timeout: 5s
retries: 5
labels:
- org.dyrectorio.service-category=_internal
# This is insecure, do not use this in production or on the public internet
# example URI: smtps://test:test@mailslurper:1025/?skip_ssl_verify=true&legacy_ssl=true
mailslurper:
Expand All @@ -180,6 +193,8 @@ services:
- 4436:4436 # web UI
- 4437:4437 # http API
restart: unless-stopped
labels:
- org.dyrectorio.service-category=_internal
volumes:
crux-db:
kratos-db:
13 changes: 13 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ services:
- letsencrypt:/letsencrypt
- ${DOCKER_SOCKET:-/var/run/docker.sock}:/var/run/docker.sock:ro
restart: unless-stopped
labels:
- org.dyrectorio.service-category=_internal
crux:
container_name: crux
image: ghcr.io/dyrector-io/dyrectorio/web/crux:${DYO_VERSION:-stable}
Expand Down Expand Up @@ -66,6 +68,7 @@ services:
- traefik.http.routers.crux-http.tls=true
- traefik.http.routers.crux-http.tls.domains[0].main=${DOMAIN}
- traefik.http.routers.crux-http.tls.certresolver=letsencrypt
- org.dyrectorio.service-category=_internal
# ports:
# - 1848:1848 # http API
crux-migrate:
Expand All @@ -79,6 +82,8 @@ services:
crux-postgres:
condition: service_healthy
restart: 'no'
labels:
- org.dyrectorio.service-category=_internal
crux-postgres:
container_name: crux-postgres
image: docker.io/library/postgres:13-alpine
Expand All @@ -93,6 +98,8 @@ services:
interval: 5s
timeout: 5s
retries: 5
labels:
- org.dyrectorio.service-category=_internal
crux-ui:
container_name: crux-ui
image: ghcr.io/dyrector-io/dyrectorio/web/crux-ui:${DYO_VERSION:-stable}
Expand All @@ -119,6 +126,7 @@ services:
- traefik.http.routers.crux-ui.tls=true
- traefik.http.routers.crux-ui.tls.domains[0].main=${DOMAIN}
- traefik.http.routers.crux-ui.tls.certresolver=letsencrypt
- org.dyrectorio.service-category=_internal
kratos:
container_name: kratos
image: ghcr.io/dyrector-io/dyrectorio/web/kratos:${DYO_VERSION:-stable}
Expand Down Expand Up @@ -157,6 +165,7 @@ services:
- traefik.http.routers.kratos.tls=true
- traefik.http.routers.kratos.tls.domains[0].main=${DOMAIN}
- traefik.http.routers.kratos.tls.certresolver=letsencrypt
- org.dyrectorio.service-category=_internal
kratos-migrate:
container_name: kratos-migrate
image: ghcr.io/dyrector-io/dyrectorio/web/kratos:${DYO_VERSION:-stable}
Expand All @@ -168,6 +177,8 @@ services:
kratos-postgres:
condition: service_healthy
restart: 'no'
labels:
- org.dyrectorio.service-category=_internal
kratos-postgres:
container_name: kratos-postgres
image: docker.io/library/postgres:13-alpine
Expand All @@ -182,6 +193,8 @@ services:
interval: 5s
timeout: 5s
retries: 5
labels:
- org.dyrectorio.service-category=_internal
# # This is insecure, do not use this in production or on the public internet
# mailslurper:
# container_name: mailslurper
Expand Down
5 changes: 5 additions & 0 deletions golang/internal/label/label.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ const (
DyrectorioOrg = "org.dyrectorio."
SecretKeys = "secret.keys"
ContainerPrefix = "container.prefix"
ServiceCategory = "service-category"
)

func GetPrefixLabelFilter(prefix string) string {
return util.JoinV("=", DyrectorioOrg+ContainerPrefix, prefix)
}

func GetHiddenServiceCategory(category string) string {
return "_" + category
}
4 changes: 3 additions & 1 deletion golang/internal/mapper/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ func MapContainerState(it *dockerTypes.Container, prefix string) *common.Contain
Ports: mapContainerPorts(&it.Ports),
ImageName: imageName[0],
ImageTag: imageTag,
Labels: it.Labels,
}
}

Expand Down Expand Up @@ -484,7 +485,8 @@ func MapDeploymentLatestPodToStateItem(
CreatedAt: timestamppb.New(
time.UnixMilli(deployment.GetCreationTimestamp().Unix() * int64(time.Microsecond)).UTC(),
),
Ports: []*common.ContainerStateItemPort{},
Ports: []*common.ContainerStateItemPort{},
Labels: deployment.Labels,
}

if containers := deployment.Spec.Template.Spec.Containers; containers != nil {
Expand Down
9 changes: 9 additions & 0 deletions golang/pkg/cli/container_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func GetCrux(state *State, args *ArgsFlags) containerbuilder.Builder {
"com.docker.compose.project": args.Prefix,
"com.docker.compose.service": state.Containers.Crux.Name,
label.DyrectorioOrg + label.ContainerPrefix: args.Prefix,
label.DyrectorioOrg + label.ServiceCategory: label.GetHiddenServiceCategory("internal"),
}).
WithPreStartHooks(getCruxInitContainer(state, args))

Expand Down Expand Up @@ -117,6 +118,7 @@ func getCruxInitContainer(state *State, args *ArgsFlags) containerbuilder.Lifecy
"com.docker.compose.project": args.Prefix,
"com.docker.compose.service": state.Containers.CruxMigrate.Name,
label.DyrectorioOrg + label.ContainerPrefix: args.Prefix,
label.DyrectorioOrg + label.ServiceCategory: label.GetHiddenServiceCategory("internal"),
})

cont, res, err := cruxMigrate.CreateAndStartWaitUntilExit()
Expand Down Expand Up @@ -213,6 +215,7 @@ func GetCruxUI(state *State, args *ArgsFlags) containerbuilder.Builder {
"com.docker.compose.project": args.Prefix,
"com.docker.compose.service": state.Containers.CruxUI.Name,
label.DyrectorioOrg + label.ContainerPrefix: args.Prefix,
label.DyrectorioOrg + label.ServiceCategory: label.GetHiddenServiceCategory("internal"),
})

if !args.FullyContainerized {
Expand Down Expand Up @@ -279,6 +282,7 @@ func GetTraefik(state *State, args *ArgsFlags) containerbuilder.Builder {
"com.docker.compose.project": args.Prefix,
"com.docker.compose.service": state.Containers.Traefik.Name,
label.DyrectorioOrg + label.ContainerPrefix: args.Prefix,
label.DyrectorioOrg + label.ServiceCategory: label.GetHiddenServiceCategory("internal"),
}).
WithPostStartHooks(func(ctx context.Context, client client.APIClient,
cont containerbuilder.ParentContainer,
Expand Down Expand Up @@ -328,6 +332,7 @@ func GetKratos(state *State, args *ArgsFlags) containerbuilder.Builder {
"com.docker.compose.project": args.Prefix,
"com.docker.compose.service": state.Containers.Kratos.Name,
label.DyrectorioOrg + label.ContainerPrefix: args.Prefix,
label.DyrectorioOrg + label.ServiceCategory: label.GetHiddenServiceCategory("internal"),
}).
WithPreStartHooks(getKratosInitContainer(state, args))

Expand Down Expand Up @@ -371,6 +376,7 @@ func getKratosInitContainer(state *State, args *ArgsFlags) containerbuilder.Life
"com.docker.compose.project": args.Prefix,
"com.docker.compose.service": state.Containers.KratosMigrate.Name,
label.DyrectorioOrg + label.ContainerPrefix: args.Prefix,
label.DyrectorioOrg + label.ServiceCategory: label.GetHiddenServiceCategory("internal"),
})

cont, res, err := kratosMigrate.CreateAndStartWaitUntilExit()
Expand Down Expand Up @@ -432,6 +438,7 @@ func GetMailSlurper(state *State, args *ArgsFlags) containerbuilder.Builder {
"com.docker.compose.project": args.Prefix,
"com.docker.compose.service": state.Containers.MailSlurper.Name,
label.DyrectorioOrg + label.ContainerPrefix: args.Prefix,
label.DyrectorioOrg + label.ServiceCategory: label.GetHiddenServiceCategory("internal"),
})

if !args.FullyContainerized {
Expand Down Expand Up @@ -470,6 +477,7 @@ func GetCruxPostgres(state *State, args *ArgsFlags) containerbuilder.Builder {
"com.docker.compose.project": args.Prefix,
"com.docker.compose.service": state.Containers.CruxPostgres.Name,
label.DyrectorioOrg + label.ContainerPrefix: args.Prefix,
label.DyrectorioOrg + label.ServiceCategory: label.GetHiddenServiceCategory("internal"),
})

if !args.FullyContainerized {
Expand Down Expand Up @@ -506,6 +514,7 @@ func GetKratosPostgres(state *State, args *ArgsFlags) containerbuilder.Builder {
"com.docker.compose.project": args.Prefix,
"com.docker.compose.service": state.Containers.KratosPostgres.Name,
label.DyrectorioOrg + label.ContainerPrefix: args.Prefix,
label.DyrectorioOrg + label.ServiceCategory: label.GetHiddenServiceCategory("internal"),
})

if !args.FullyContainerized {
Expand Down
Loading