From f8ed5cd7792d9443ddb4ff5250121e0257189eab Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 30 Apr 2019 13:16:29 +0200 Subject: [PATCH] Fix Docker setup and add back back an entrypoint * Also add special deps for argon2 support inside the Alpine image * Make sure yarn install is triggered Signed-off-by: Thomas Citharel --- Dockerfile | 3 +-- docker-compose.yml | 2 +- lib/mobilizon_web/controllers/page_controller.ex | 4 ++-- lib/mobilizon_web/views/layout_view.ex | 1 - mix.exs | 8 +++++++- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 18a2c18a8..029e6a58e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,10 @@ FROM bitwalker/alpine-elixir:latest RUN apk add inotify-tools postgresql-client yarn +RUN apk add --no-cache make gcc libc-dev RUN mix local.hex --force && mix local.rebar --force -COPY docker/entrypoint.sh /bin/entrypoint - WORKDIR /app EXPOSE 4000 4001 4002 diff --git a/docker-compose.yml b/docker-compose.yml index 6d92a9b2f..1234cd96c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,7 +30,7 @@ services: MOBILIZON_DATABASE_USERNAME: postgres MOBILIZON_DATABASE_DBNAME: mobilizon_dev MOBILIZON_DATABASE_HOST: postgres - command: "mix phx.migrate_serve" + command: "mix phx.deps_migrate_serve" volumes: pgdata: .: diff --git a/lib/mobilizon_web/controllers/page_controller.ex b/lib/mobilizon_web/controllers/page_controller.ex index de04a5e96..5bb761542 100644 --- a/lib/mobilizon_web/controllers/page_controller.ex +++ b/lib/mobilizon_web/controllers/page_controller.ex @@ -11,7 +11,7 @@ defmodule MobilizonWeb.PageController do action_fallback(MobilizonWeb.FallbackController) def index(conn, _params) do - render conn, "app.html" + render(conn, "app.html") end def actor(conn, %{"name" => name}) do @@ -73,6 +73,6 @@ defmodule MobilizonWeb.PageController do # Inject OpenGraph information defp render_with_meta(conn, object) do - render conn, "app.html", object: object + render(conn, "app.html", object: object) end end diff --git a/lib/mobilizon_web/views/layout_view.ex b/lib/mobilizon_web/views/layout_view.ex index 30dd657bc..6e91e14cf 100644 --- a/lib/mobilizon_web/views/layout_view.ex +++ b/lib/mobilizon_web/views/layout_view.ex @@ -1,5 +1,4 @@ defmodule MobilizonWeb.LayoutView do use MobilizonWeb, :view alias Mobilizon.Service.Metadata - end diff --git a/mix.exs b/mix.exs index eb8b0002c..8ab8ace92 100644 --- a/mix.exs +++ b/mix.exs @@ -117,7 +117,13 @@ defmodule Mobilizon.Mixfile do "ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"], "ecto.reset": ["ecto.drop", "ecto.setup"], test: ["ecto.create --quiet", "ecto.migrate", "test"], - "phx.migrate_serve": ["ecto.create --quiet", "ecto.migrate", "phx.server"] + "phx.deps_migrate_serve": [ + "deps.get", + "ecto.create --quiet", + "ecto.migrate", + "cmd cd js && yarn install && cd ../", + "phx.server" + ] ] end