and run the release stuff on the outside

3c0a6a9 · gmorell · 2022-07-29 02:29

10 files +81 -13

Files changed

modified app.yml
+21 −7
@@ -38,9 +38,6 @@ spec:
38 38 # secretKeyRef:
39 39 # name: wed4u-secrets
40 40 # key: sentrydsn
41 − - name: PORT
42 − value: "8080"
43 −
44 41 - name: SECRET_KEY_BASE
45 42 valueFrom:
46 43 secretKeyRef:
@@ -84,14 +81,18 @@ spec:
84 81 key: password
85 82
86 83 - name: DATABASE_URL
87 − value: ecto://$(POSTGRES_USER):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT)/csnap
84 + value: ecto://$(POSTGRES_USER):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT)/apolloscrib
88 85
89 86 - name: RABBIT_URL
90 87 value: amqp://$(AMQP_USER_USER):$(AMQP_PASS)@rabbitmq:5672
91 88
89 + - name: PHX_HOST
90 + value: ac.gmp.io
91 +
92 92 name: apollos-crib
93 93 ports:
94 − - containerPort: 8080
94 + - containerPort: 4000
95 + - containerPort: 4001
95 96
96 97 imagePullSecrets:
97 98 - name: gitlabgmp
@@ -104,10 +105,23 @@ metadata:
104 105 spec:
105 106 ports:
106 107 - port: 80
107 − targetPort: 8080
108 + targetPort: 4000
109 + protocol: TCP
110 + selector:
111 + name: apollos-crib
112 +---
113 +apiVersion: v1
114 +kind: Service
115 +metadata:
116 + name: apollos-crib-hermes-svc
117 + namespace: apollos-crib
118 +spec:
119 + ports:
120 + - port: 80
121 + targetPort: 4001
108 122 protocol: TCP
109 123 selector:
110 − app: apollos-crib
124 + name: apollos-crib
111 125 ---
112 126 apiVersion: networking.k8s.io/v1
113 127 kind: Ingress
modified config/prod.exs
+12 −4
@@ -11,10 +11,11 @@ import Config
11 11 # before starting your production server.
12 12 config :room_hermes,
13 13 RoomHermes.Endpoint,
14 − url: [
15 − host: "example.com",
16 − port: 80
17 − ],
14 + load_from_system_env: true,
15 + http: [port: 4041],
16 + check_origin: false,
17 + server: true,
18 + root: ".",
18 19 cache_static_manifest: "priv/static/cache_manifest.json"
19 20
20 21 # ## SSL Support
@@ -61,8 +62,15 @@ config :room_hermes,
61 62 # which you should run after static files are built and
62 63 # before starting your production server.
63 64 config :room_sanctum, RoomSanctumWeb.Endpoint,
65 + load_from_system_env: true,
66 + http: [port: 4040],
67 + check_origin: false,
68 + server: true,
69 + root: ".",
64 70 cache_static_manifest: "priv/static/cache_manifest.json"
65 71
72 +
73 +
66 74 # Do not print debug messages in production
67 75 config :logger, level: :info
68 76
modified config/runtime.exs
+2 −2
@@ -31,7 +31,7 @@ if config_env() == :prod do
31 31 # Enable IPv6 and bind on all interfaces.
32 32 # Set it to {0, 0, 0, 0, 0, 0, 0, 1} for local network only access.
33 33 ip: {0, 0, 0, 0, 0, 0, 0, 0},
34 − port: String.to_integer(System.get_env("PORT") || "4001")
34 + port: String.to_integer(System.get_env("HPORT") || "4001")
35 35 ],
36 36 secret_key_base: secret_key_base
37 37
@@ -91,7 +91,7 @@ if config_env() == :prod do
91 91 """
92 92
93 93 host = System.get_env("PHX_HOST") || "example.com"
94 − port = String.to_integer(System.get_env("PORT") || "4000")
94 + port = String.to_integer(System.get_env("SPORT") || "4000")
95 95
96 96 config :room_sanctum, RoomSanctumWeb.Endpoint,
97 97 url: [host: host, port: 443],
modified mix.exs
+2 −0
@@ -12,6 +12,8 @@ defmodule ApollosCrib.MixProject do
12 12 include_erts: true,
13 13 include_executables_for: [:unix],
14 14 applications: [
15 + room_sanctum: :permanent,
16 + room_hermes: :permanent,
15 17 runtime_tools: :permanent
16 18 ]
17 19 ]
added rel/env.bat.eex
+5 −0
@@ -0,0 +1,5 @@
1 +@echo off
2 +rem Set the release to work across nodes.
3 +rem RELEASE_DISTRIBUTION must be "sname" (local), "name" (distributed) or "none".
4 +rem set RELEASE_DISTRIBUTION=name
5 +rem set RELEASE_NODE=<%= @release.name %>
added rel/env.sh.eex
+17 −0
@@ -0,0 +1,17 @@
1 +#!/bin/sh
2 +
3 +# Sets and enables heart (recommended only in daemon mode)
4 +# case $RELEASE_COMMAND in
5 +# daemon*)
6 +# HEART_COMMAND="$RELEASE_ROOT/bin/$RELEASE_NAME $RELEASE_COMMAND"
7 +# export HEART_COMMAND
8 +# export ELIXIR_ERL_OPTIONS="-heart"
9 +# ;;
10 +# *)
11 +# ;;
12 +# esac
13 +
14 +# Set the release to work across nodes.
15 +# RELEASE_DISTRIBUTION must be "sname" (local), "name" (distributed) or "none".
16 +# export RELEASE_DISTRIBUTION=name
17 +# export RELEASE_NODE=<%= @release.name %>
added rel/remote.vm.args.eex
+11 −0
@@ -0,0 +1,11 @@
1 +## Customize flags given to the VM: https://erlang.org/doc/man/erl.html
2 +## -mode/-name/-sname/-setcookie are configured via env vars, do not set them here
3 +
4 +## Number of dirty schedulers doing IO work (file, sockets, and others)
5 +##+SDio 5
6 +
7 +## Increase number of concurrent ports/sockets
8 +##+Q 65536
9 +
10 +## Tweak GC to run more often
11 +##-env ERL_FULLSWEEP_AFTER 10
added rel/vm.args.eex
+11 −0
@@ -0,0 +1,11 @@
1 +## Customize flags given to the VM: https://erlang.org/doc/man/erl.html
2 +## -mode/-name/-sname/-setcookie are configured via env vars, do not set them here
3 +
4 +## Number of dirty schedulers doing IO work (file, sockets, and others)
5 +##+SDio 5
6 +
7 +## Increase number of concurrent ports/sockets
8 +##+Q 65536
9 +
10 +## Tweak GC to run more often
11 +##-env ERL_FULLSWEEP_AFTER 10

Parents: 4a798f3