diff --git a/docker-compose.production.yml b/docker-compose.production.yml index 6bf594a..930125d 100644 --- a/docker-compose.production.yml +++ b/docker-compose.production.yml @@ -1,7 +1,7 @@ -# The only stuff that happens here is midtownplaydio gets replaced and so does possibly nixius +# The only stuff that happens here is template gets replaced and so does possibly nixius services: - midtownplaydio: + template: build: - context: ./docker/midtownplaydio + context: ./docker/template dockerfile: Dockerfile.production - image: git.nixc.us/nixius/midtownplaydio:production \ No newline at end of file + image: git.nixc.us/nixius/template:production \ No newline at end of file diff --git a/docker-compose.staging.yml b/docker-compose.staging.yml index a5bf114..a96c565 100644 --- a/docker-compose.staging.yml +++ b/docker-compose.staging.yml @@ -1,7 +1,7 @@ -# The only stuff that happens here is midtownplaydio gets replaced and so does possibly nixius +# The only stuff that happens here is template gets replaced and so does possibly nixius services: - midtownplaydio: + template: build: - context: ./docker/midtownplaydio - dockerfile: Dockerfile - image: git.nixc.us/colin/midtownplaydio:staging \ No newline at end of file + context: ./docker/template + dockerfile: Dockerfile.staging + image: git.nixc.us/colin/template:staging \ No newline at end of file diff --git a/docker/midtownplaydio/Dockerfile b/docker/midtownplaydio/Dockerfile deleted file mode 100644 index 7fcf687..0000000 --- a/docker/midtownplaydio/Dockerfile +++ /dev/null @@ -1 +0,0 @@ -# This is the Dockerfile where most stuff gets added for stating then production virtually nothing should go into Dockerfile.production outside of args and env's Clean up this comment. \ No newline at end of file diff --git a/docker/midtownplaydio/Dockerfile.production b/docker/midtownplaydio/Dockerfile.production deleted file mode 100644 index 92fac18..0000000 --- a/docker/midtownplaydio/Dockerfile.production +++ /dev/null @@ -1,2 +0,0 @@ -# This should almost never need more than this line but can if absolutely necessary. -FROM git.nixc.us/nixius/midtownplaydio:staging \ No newline at end of file diff --git a/stack.production.yml b/stack.production.yml index 739818f..ccb74b1 100644 --- a/stack.production.yml +++ b/stack.production.yml @@ -3,6 +3,35 @@ networks: external: true services: + template: + image: git.nixc.us/nixius/template:production + deploy: + replicas: 1 + restart_policy: + condition: on-failure + max_attempts: 3 + update_config: + parallelism: 1 + delay: 10s + order: start-first + rollback_config: + parallelism: 1 + delay: 10s + order: stop-first + networks: + - traefik_network + labels: + - traefik.enable=true + - traefik.http.routers.production_template.rule=Host(`template.nixc.us`) + - traefik.http.routers.production_template.entrypoints=websecure + - traefik.http.routers.production_template.tls=true + - traefik.http.routers.production_template.tls.certresolver=letsencryptresolver + - traefik.http.services.production_template.loadbalancer.server.port=3000 + # - traefik.http.services.production_template.loadbalancer.healthcheck.path=/health + # - traefik.http.services.production_template.loadbalancer.healthcheck.interval=30s + # - traefik.http.services.production_template.loadbalancer.healthcheck.timeout=5s + - traefik.http.routers.production_template.middlewares=secure-headers + midtownplaydio: image: git.nixc.us/nixius/midtownplaydio:production networks: @@ -23,6 +52,7 @@ services: traefik.http.routers.production_midtownplaydio.entrypoints: "websecure" traefik.http.routers.production_midtownplaydio.tls: "true" traefik.http.routers.production_midtownplaydio.tls.certresolver: "letsencryptresolver" + traefik.http.routers.production_midtownplaydio.middlewares: "secure-headers" traefik.http.services.production_midtownplaydio.loadbalancer.server.port: "3000" traefik.docker.network: "traefik" # traefik.http.services.production_midtownplaydio.loadbalancer.healthcheck.path: "/health" @@ -39,6 +69,3 @@ services: traefik.http.middlewares.secure-headers.headers.browserXssFilter: "true" traefik.http.middlewares.secure-headers.headers.referrerPolicy: "no-referrer" traefik.http.middlewares.secure-headers.headers.featurePolicy: "camera 'none'; geolocation 'none'; microphone 'none'; payment 'none'; usb 'none'; vr 'none'" - - # Attach security headers middleware to the router - traefik.http.routers.production_midtownplaydio.middlewares: "secure-headers" diff --git a/stack.staging.yml b/stack.staging.yml index c9b2ce3..2cbc217 100644 --- a/stack.staging.yml +++ b/stack.staging.yml @@ -4,32 +4,30 @@ networks: default: services: - midtownplaydio: - image: git.nixc.us/nixius/midtownplaydio:staging - networks: - - traefik - - default + template: + image: git.nixc.us/nixius/template:staging deploy: replicas: 1 - placement: - constraints: - - node.hostname == ingress.nixc.us - preferences: - - spread: node.id restart_policy: condition: on-failure + max_attempts: 3 update_config: - delay: 20s parallelism: 1 + delay: 10s order: start-first - labels: - traefik.enable: "true" - traefik.http.routers.staging_midtownplaydio.rule: "Host(`staging.midtownplaydio.nixc.us`)" - traefik.http.routers.staging_midtownplaydio.entrypoints: "websecure" - traefik.http.routers.staging_midtownplaydio.tls: "true" - traefik.http.routers.staging_midtownplaydio.tls.certresolver: "letsencryptresolver" - traefik.http.services.staging_midtownplaydio.loadbalancer.server.port: "3000" - traefik.docker.network: "traefik" - # traefik.http.services.staging_midtownplaydio.loadbalancer.healthcheck.path: "/health" - # traefik.http.services.staging_midtownplaydio.loadbalancer.healthcheck.interval: "30s" - # traefik.http.services.staging_midtownplaydio.loadbalancer.healthcheck.timeout: "5s" + rollback_config: + parallelism: 1 + delay: 10s + order: stop-first + networks: + - traefik_network + labels: + - traefik.enable=true + - traefik.http.routers.staging_template.rule=Host(`staging.template.nixc.us`) + - traefik.http.routers.staging_template.entrypoints=websecure + - traefik.http.routers.staging_template.tls=true + - traefik.http.routers.staging_template.tls.certresolver=letsencryptresolver + - traefik.http.services.staging_template.loadbalancer.server.port=3000 + # - traefik.http.services.staging_template.loadbalancer.healthcheck.path=/health + # - traefik.http.services.staging_template.loadbalancer.healthcheck.interval=30s + # - traefik.http.services.staging_template.loadbalancer.healthcheck.timeout=5s