Pulumi code for my server setup
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add persistent traefik volume

not sure if this actually makes a difference compared to just defining
it in the mounts but it's more explicit I guess

+13 -5
+10 -4
src/index.ts
··· 1 1 import * as pulumi from "@pulumi/pulumi"; 2 + import * as docker from "@pulumi/docker"; 2 3 import { ContainerService } from "./service"; 3 4 import { getEnv } from "./env"; 4 5 ··· 23 24 type: "bind", 24 25 }; 25 26 27 + const traefikVolume = new docker.Volume("traefik", { 28 + name: "traefik", 29 + }); 30 + 26 31 const traefikService = await ContainerService.create("traefik", { 27 32 image: "traefik", 28 33 webPort: 8080, 29 - mounts: [ 34 + volumes: [ 30 35 { 31 - source: "traefik", 32 - target: "/etc/traefik", 33 - type: "volume", 36 + volumeName: traefikVolume.name, 37 + containerPath: "/etc/traefik", 34 38 }, 39 + ], 40 + mounts: [ 35 41 { 36 42 source: "/var/run/docker.sock", 37 43 target: "/var/run/docker.sock",
+3 -1
src/service.ts
··· 119 119 labels: Record<string, string>; 120 120 envs: string[]; 121 121 mounts: docker.types.input.ContainerMount[]; 122 + volumes: docker.types.input.ContainerVolume[]; 122 123 ports: (`${number}:${number}` | number)[]; 123 124 extraContainerOptions: Partial<docker.ContainerArgs>; 124 125 }, ··· 207 208 envs, 208 209 ports: convertPorts(args.ports), 209 210 mounts: args.mounts, 211 + volumes: args.volumes, 210 212 ...args.extraContainerOptions, 211 213 }; 212 214 ··· 228 230 this.container = new docker.Container(name, containerArgs, { 229 231 parent: this, 230 232 deleteBeforeReplace: true, 231 - replaceOnChanges: ["mounts"], 233 + replaceOnChanges: ["mounts", "volumes"], 232 234 }); 233 235 234 236 this.registerOutputs({