refactor: docker volume prefix

This commit is contained in:
Nicolas Meienberger
2025-09-27 14:49:22 +02:00
parent 88e310cc4f
commit aa32ea322d
8 changed files with 29 additions and 24 deletions

View File

@@ -16,17 +16,17 @@ export const DockerTabContent = ({ volume }: Props) => {
services: {
nginx: {
image: "nginx:latest",
volumes: [`${volume.name}:/path/in/container`],
volumes: [`im-${volume.name}:/path/in/container`],
},
},
volumes: {
[volume.name]: {
[`im-${volume.name}`]: {
external: true,
},
},
});
const dockerRunCommand = `docker run -v ${volume.name}:/path/in/container nginx:latest`;
const dockerRunCommand = `docker run -v im-${volume.name}:/path/in/container nginx:latest`;
const containersQuery = getContainersUsingVolumeOptions({ path: { name: volume.name } });
const { data: containersData, isLoading, error } = useQuery(containersQuery);

View File

@@ -41,6 +41,8 @@ export default function DetailsPage({ loaderData }: Route.ComponentProps) {
const { data } = useQuery({
...getVolumeOptions({ path: { name: name ?? "" } }),
initialData: loaderData,
refetchInterval: 10000,
refetchOnWindowFocus: true,
});
const deleteVol = useMutation({

View File

@@ -48,6 +48,8 @@ export default function Home({ loaderData }: Route.ComponentProps) {
const { data } = useQuery({
...listVolumesOptions(),
initialData: loaderData,
refetchInterval: 10000,
refetchOnWindowFocus: true,
});
const filteredVolumes =