Fakultas Ilmu Komputer UI

Commit 1076f45d authored by Muhammad Rafif Elfazri's avatar Muhammad Rafif Elfazri
Browse files

Merge branch 'deploy-runtime' into 'master'

Deploy runtime

See merge request !5
parents dd5881a3 10c6f336
SECRET_KEY_BASE=REALLY_LONG_SECRET
GUARDIAN_SECRET_KEY_BASE=REALLY_LONG_SECRET
DATABASE_HOST=db
DATABASE_URL=ecto://postgres:postgres@db/postgres
PORT=4000
......
......@@ -23,6 +23,13 @@ secret_key_base =
You can generate one by calling: mix phx.gen.secret
"""
guardian_secret_key_base =
System.get_env("GUARDIAN_SECRET_KEY_BASE") ||
raise """
environment variable GUARDIAN_SECRET_KEY_BASE is missing.
You can generate one by calling: mix guardian.gen.secret
"""
config :diskuy, DiskuyWeb.Endpoint,
http: [
port: String.to_integer(System.get_env("PORT") || "4000"),
......@@ -30,6 +37,11 @@ config :diskuy, DiskuyWeb.Endpoint,
],
secret_key_base: secret_key_base
config :diskuy, DiskuyWeb.Auth.Guardian,
issuer: "diskuy",
secret_key: guardian_secret_key_base
# ## Using releases (Elixir v1.9+)
#
# If you are doing OTP releases, you need to instruct Phoenix
......
......@@ -3,14 +3,14 @@
# docker entrypoint script.
# assign a default for the database_user
# DB_USER=${DATABASE_USER:-postgres}
DB_USER=${DATABASE_USER:-postgres}
# # wait until Postgres is ready
# while ! pg_isready -q -h $DATABASE_HOST -p 5432 -U $DB_USER
# do
# echo "$(date) - waiting for database to start"
# sleep 2
# done
# wait until Postgres is ready
while ! pg_isready -q -h $DATABASE_HOST -p 5432 -U $DB_USER
do
echo "$(date) - waiting for database to start"
sleep 2
done
bin="/app/bin/diskuy"
eval "$bin eval \"Diskuy.Release.migrate\""
......
......@@ -18,7 +18,8 @@ defmodule Diskuy.Forum do
"""
def list_topics do
Repo.all(Topic)
query = from t in Topic, order_by: t.name
Repo.all(query)
end
@doc """
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment