From ca5a3febfc235f05cf3471cea73e694fa182ac39 Mon Sep 17 00:00:00 2001 From: hisa Date: Wed, 28 Sep 2016 19:15:00 -0400 Subject: [PATCH] Fix Dockerfile. Fix typo in README. Fix mix.lock after compiled with Elixir 1.3 in application in mix.exs Fix missing role in repo seeds --- Dockerfile | 7 +++---- README.md | 2 +- mix.lock | 6 +++--- priv/repo/seeds.exs | 1 + 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2dedd2e..14d4b9a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,9 +45,8 @@ ENV APP_MIX_DEPS_DIR /home/app/mix_deps RUN mkdir $APP_MIX_DEPS_DIR RUN cd $APP_HOME && ln -s $APP_MIX_DEPS_DIR deps COPY mix.exs mix.lock $APP_HOME/ -RUN mkdir $APP_HOME/config # Some packages like Guardian require specific config to compile -COPY config/config.exs $APP_HOME/config/config.exs -COPY config/dev.exs $APP_HOME/config/*.exs +RUN mkdir $APP_HOME/config # Some packages like Guardian require specific config to compile +COPY config $APP_HOME/config/ RUN chown -R app:staff /home/app && chmod -R g+s /home/app RUN setuser app mix do deps.get --force, deps.compile @@ -66,7 +65,7 @@ COPY . $APP_HOME RUN chown -R app:staff /home/app && chmod -R g+s /home/app # Uninstall some "heavy" packages and clean up apt-get -RUN apt-get remove build-essential +RUN apt-get remove build-essential -y RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # Enable SSH (Authorized keys must be copied in each specific project/environment) diff --git a/README.md b/README.md index 51b0ec6..72ec59a 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ Once inside the container, you'll need to switch to **app** user in order to exe Once switched to **app** user and in the `APP_HOME` directory, you can: 1. Create and migrate **dev** database: `mix do ecto.create, ecto.migrate` -2. Create and migrate **test** database: `MIX_ENV=mix do ecto.create, ecto.migrate` +2. Create and migrate **test** database: `MIX_ENV=test do ecto.create, ecto.migrate` 3. Run db seeds to create a **superadmin** dev user: `mix run priv/repo/seeds.exs`. Take a look at the seeds file to get the corresponding credentials. 4. Start the application server: `mix phoenix.server`, or if you want to start the server in a Elixir console `iex -S mix phoenix.server` diff --git a/mix.lock b/mix.lock index 41db2b6..6c45926 100644 --- a/mix.lock +++ b/mix.lock @@ -21,9 +21,9 @@ "meck": {:hex, :meck, "0.8.4", "59ca1cd971372aa223138efcf9b29475bde299e1953046a0c727184790ab1520", [:rebar, :make], []}, "mime": {:hex, :mime, "1.0.1", "05c393850524767d13a53627df71beeebb016205eb43bfbd92d14d24ec7a1b51", [:mix], []}, "mix_test_watch": {:hex, :mix_test_watch, "0.2.6", "9fcc2b1b89d1594c4a8300959c19d50da2f0ff13642c8f681692a6e507f92cab", [:mix], [{:fs, "~> 0.9.1", [hex: :fs, optional: false]}]}, - "phoenix": {:hex, :phoenix, "1.2.0", "1bdeb99c254f4c534cdf98fd201dede682297ccc62fcac5d57a2627c3b6681fb", [:mix], [{:cowboy, "~> 1.0", [hex: :cowboy, optional: true]}, {:phoenix_pubsub, "~> 1.0", [hex: :phoenix_pubsub, optional: false]}, {:plug, "~> 1.1", [hex: :plug, optional: false]}, {:poison, "~> 1.5 or ~> 2.0", [hex: :poison, optional: false]}]}, - "phoenix_ecto": {:hex, :phoenix_ecto, "3.0.0", "b947aaf03d076f5b1448f87828f22fb7710478ee38455c67cc3fe8e9a4dfd015", [:mix], [{:ecto, "~> 2.0.0-rc", [hex: :ecto, optional: false]}, {:phoenix_html, "~> 2.6", [hex: :phoenix_html, optional: true]}]}, - "phoenix_html": {:hex, :phoenix_html, "2.6.2", "944a5e581b0d899e4f4c838a69503ebd05300fe35ba228a74439e6253e10e0c0", [:mix], [{:plug, "~> 1.0", [hex: :plug, optional: false]}]}, + "phoenix": {:hex, :phoenix, "1.2.1", "6dc592249ab73c67575769765b66ad164ad25d83defa3492dc6ae269bd2a68ab", [:mix], [{:cowboy, "~> 1.0", [hex: :cowboy, optional: true]}, {:phoenix_pubsub, "~> 1.0", [hex: :phoenix_pubsub, optional: false]}, {:plug, "~> 1.1", [hex: :plug, optional: false]}, {:poison, "~> 1.5 or ~> 2.0", [hex: :poison, optional: false]}]}, + "phoenix_ecto": {:hex, :phoenix_ecto, "3.0.1", "42eb486ef732cf209d0a353e791806721f33ff40beab0a86f02070a5649ed00a", [:mix], [{:ecto, "~> 2.0", [hex: :ecto, optional: false]}, {:phoenix_html, "~> 2.6", [hex: :phoenix_html, optional: true]}, {:plug, "~> 1.0", [hex: :plug, optional: false]}]}, + "phoenix_html": {:hex, :phoenix_html, "2.7.0", "19e12e2044340c2e43df206a06d059677c59ea1868bd1c35165438d592cd420b", [:mix], [{:plug, "~> 1.0", [hex: :plug, optional: false]}]}, "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.0.5", "829218c4152ba1e9848e2bf8e161fcde6b4ec679a516259442561d21fde68d0b", [:mix], [{:fs, "~> 0.9.1", [hex: :fs, optional: false]}, {:phoenix, "~> 1.0 or ~> 1.2-rc", [hex: :phoenix, optional: false]}]}, "phoenix_pubsub": {:hex, :phoenix_pubsub, "1.0.0", "c31af4be22afeeebfaf246592778c8c840e5a1ddc7ca87610c41ccfb160c2c57", [:mix], []}, "plug": {:hex, :plug, "1.2.0", "496bef96634a49d7803ab2671482f0c5ce9ce0b7b9bc25bc0ae8e09859dd2004", [:mix], [{:cowboy, "~> 1.0", [hex: :cowboy, optional: true]}, {:mime, "~> 1.0", [hex: :mime, optional: false]}]}, diff --git a/priv/repo/seeds.exs b/priv/repo/seeds.exs index 66d722b..ca4a64d 100644 --- a/priv/repo/seeds.exs +++ b/priv/repo/seeds.exs @@ -14,6 +14,7 @@ alias Webapp.User %User{} |> User.registration_changeset(%{ + role: "superadmin", first_name: "John", last_name: "Rambo", email: "jrambo@test.com",