From dd807c55dc8252f2097089ed09e2d7453c0f56b5 Mon Sep 17 00:00:00 2001 From: Maygician Date: Sat, 3 Oct 2020 12:27:12 +0700 Subject: [PATCH] prod secret. don't do that --- docs/GCP deploy | 4 +++- docs/deployment | 7 +++++++ lp/.gitignore | 5 +++++ lp/config/prod.exs | 6 ++++-- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/docs/GCP deploy b/docs/GCP deploy index 5e22113..1d48355 100644 --- a/docs/GCP deploy +++ b/docs/GCP deploy @@ -1,6 +1,6 @@ # commands from dev env should work. # you'd need to add prod database to env, like this (don't use this exact one) -# export DATABASE_URL=ecto://postgres:postgres@localhost/gclp_dev +# export DATABASE_URL=ecto://postgres:postgres@localhost/lp_dev # and gen a secret: export SECRET_KEY_BASE=`mix phx.gen.secret` # open ports you want to use for prod in firewall rules(instance settings) @@ -26,3 +26,5 @@ cd lp mix deps.get mix deps.compile mix ecto.create +# fetch prod.exs config file + diff --git a/docs/deployment b/docs/deployment index e69de29..7dd751a 100644 --- a/docs/deployment +++ b/docs/deployment @@ -0,0 +1,7 @@ +git pull origin pet +mix deps.get --only prod +# mix phx.digest # once you have something js related +MIX_ENV=prod mix compile +MIX_ENV=prod mix release +_build/prod/rel/lp/bin/lp start +# note, that it is running in terminal diff --git a/lp/.gitignore b/lp/.gitignore index dbd3cbc..9107524 100644 --- a/lp/.gitignore +++ b/lp/.gitignore @@ -32,3 +32,8 @@ npm-debug.log # we ignore priv/static. You may want to comment # this depending on your deployment strategy. /priv/static/ + +# find the way to get your prod secret to prod server +# leaving you an example +/config/prod.exs +/config/prod.secret.exs \ No newline at end of file diff --git a/lp/config/prod.exs b/lp/config/prod.exs index d68fd79..bc8d5d6 100644 --- a/lp/config/prod.exs +++ b/lp/config/prod.exs @@ -10,8 +10,10 @@ use Mix.Config # which you should run after static files are built and # before starting your production server. config :lp, LpWeb.Endpoint, - url: [host: "example.com", port: 80], - cache_static_manifest: "priv/static/cache_manifest.json" + # url: [host: "example.com", port: 80], + url: [host: "35.193.215.48", port: 9999], +#usually you would not want to do that, but i'm lazy. adjust to your machine + # cache_static_manifest: "priv/static/cache_manifest.json" # Do not print debug messages in production config :logger, level: :info