prod secret. don't do that

This commit is contained in:
Maygician 2020-10-03 12:27:12 +07:00
commit dd807c55dc
4 changed files with 19 additions and 3 deletions

View file

@ -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

View file

@ -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

5
lp/.gitignore vendored
View file

@ -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

View file

@ -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