Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Functional Programming
Diskuy-Backend
Commits
1076f45d
Commit
1076f45d
authored
Feb 20, 2021
by
Muhammad Rafif Elfazri
Browse files
Merge branch 'deploy-runtime' into 'master'
Deploy runtime See merge request
!5
parents
dd5881a3
10c6f336
Changes
4
Hide whitespace changes
Inline
Side-by-side
config/docker.env
View file @
1076f45d
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
...
...
config/releases.exs
View file @
1076f45d
...
...
@@ -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
...
...
entrypoint.sh
View file @
1076f45d
...
...
@@ -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
\"
"
...
...
lib/diskuy/forum.ex
View file @
1076f45d
...
...
@@ -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
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment