Skip to content

Commit

Permalink
and run the release stuff on the outside
Browse files Browse the repository at this point in the history
  • Loading branch information
gmorell committed Jul 29, 2022
1 parent 4a798f3 commit 3c0a6a9
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 13 deletions.
28 changes: 21 additions & 7 deletions app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ spec:
# secretKeyRef:
# name: wed4u-secrets
# key: sentrydsn
- name: PORT
value: "8080"

- name: SECRET_KEY_BASE
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -84,14 +81,18 @@ spec:
key: password

- name: DATABASE_URL
value: ecto://$(POSTGRES_USER):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT)/csnap
value: ecto://$(POSTGRES_USER):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT)/apolloscrib

- name: RABBIT_URL
value: amqp://$(AMQP_USER_USER):$(AMQP_PASS)@rabbitmq:5672

- name: PHX_HOST
value: ac.gmp.io

name: apollos-crib
ports:
- containerPort: 8080
- containerPort: 4000
- containerPort: 4001

imagePullSecrets:
- name: gitlabgmp
Expand All @@ -104,10 +105,23 @@ metadata:
spec:
ports:
- port: 80
targetPort: 8080
targetPort: 4000
protocol: TCP
selector:
name: apollos-crib
---
apiVersion: v1
kind: Service
metadata:
name: apollos-crib-hermes-svc
namespace: apollos-crib
spec:
ports:
- port: 80
targetPort: 4001
protocol: TCP
selector:
app: apollos-crib
name: apollos-crib
---
apiVersion: networking.k8s.io/v1
kind: Ingress
Expand Down
16 changes: 12 additions & 4 deletions config/prod.exs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ import Config
# before starting your production server.
config :room_hermes,
RoomHermes.Endpoint,
url: [
host: "example.com",
port: 80
],
load_from_system_env: true,
http: [port: 4041],
check_origin: false,
server: true,
root: ".",
cache_static_manifest: "priv/static/cache_manifest.json"

# ## SSL Support
Expand Down Expand Up @@ -61,8 +62,15 @@ config :room_hermes,
# which you should run after static files are built and
# before starting your production server.
config :room_sanctum, RoomSanctumWeb.Endpoint,
load_from_system_env: true,
http: [port: 4040],
check_origin: false,
server: true,
root: ".",
cache_static_manifest: "priv/static/cache_manifest.json"



# Do not print debug messages in production
config :logger, level: :info

Expand Down
4 changes: 2 additions & 2 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if config_env() == :prod do
# Enable IPv6 and bind on all interfaces.
# Set it to {0, 0, 0, 0, 0, 0, 0, 1} for local network only access.
ip: {0, 0, 0, 0, 0, 0, 0, 0},
port: String.to_integer(System.get_env("PORT") || "4001")
port: String.to_integer(System.get_env("HPORT") || "4001")
],
secret_key_base: secret_key_base

Expand Down Expand Up @@ -91,7 +91,7 @@ if config_env() == :prod do
"""

host = System.get_env("PHX_HOST") || "example.com"
port = String.to_integer(System.get_env("PORT") || "4000")
port = String.to_integer(System.get_env("SPORT") || "4000")

config :room_sanctum, RoomSanctumWeb.Endpoint,
url: [host: host, port: 443],
Expand Down
2 changes: 2 additions & 0 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ defmodule ApollosCrib.MixProject do
include_erts: true,
include_executables_for: [:unix],
applications: [
room_sanctum: :permanent,
room_hermes: :permanent,
runtime_tools: :permanent
]
]
Expand Down
5 changes: 5 additions & 0 deletions rel/env.bat.eex
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@echo off
rem Set the release to work across nodes.
rem RELEASE_DISTRIBUTION must be "sname" (local), "name" (distributed) or "none".
rem set RELEASE_DISTRIBUTION=name
rem set RELEASE_NODE=<%= @release.name %>
17 changes: 17 additions & 0 deletions rel/env.sh.eex
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

# Sets and enables heart (recommended only in daemon mode)
# case $RELEASE_COMMAND in
# daemon*)
# HEART_COMMAND="$RELEASE_ROOT/bin/$RELEASE_NAME $RELEASE_COMMAND"
# export HEART_COMMAND
# export ELIXIR_ERL_OPTIONS="-heart"
# ;;
# *)
# ;;
# esac

# Set the release to work across nodes.
# RELEASE_DISTRIBUTION must be "sname" (local), "name" (distributed) or "none".
# export RELEASE_DISTRIBUTION=name
# export RELEASE_NODE=<%= @release.name %>
11 changes: 11 additions & 0 deletions rel/remote.vm.args.eex
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Customize flags given to the VM: https://erlang.org/doc/man/erl.html
## -mode/-name/-sname/-setcookie are configured via env vars, do not set them here

## Number of dirty schedulers doing IO work (file, sockets, and others)
##+SDio 5

## Increase number of concurrent ports/sockets
##+Q 65536

## Tweak GC to run more often
##-env ERL_FULLSWEEP_AFTER 10
11 changes: 11 additions & 0 deletions rel/vm.args.eex
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Customize flags given to the VM: https://erlang.org/doc/man/erl.html
## -mode/-name/-sname/-setcookie are configured via env vars, do not set them here

## Number of dirty schedulers doing IO work (file, sockets, and others)
##+SDio 5

## Increase number of concurrent ports/sockets
##+Q 65536

## Tweak GC to run more often
##-env ERL_FULLSWEEP_AFTER 10

0 comments on commit 3c0a6a9

Please sign in to comment.