Skip to content

Commit

Permalink
Fix docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylan Kendal committed Mar 2, 2017
1 parent a4f49a2 commit 5aab36e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN mix compile
RUN mkdir -p databases
RUN mix test
RUN rm -rf databases/dev
RUN mix battle_snake.schema
RUN mix setup
EXPOSE 4000
ENV PORT 4000
CMD mix phoenix.server
16 changes: 2 additions & 14 deletions lib/mix/tasks/battle_snake/schema.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,16 @@ defmodule Mix.Tasks.BattleSnake.Schema.Drop do

@shortdoc "delete the current schema"
def run(_) do
:mnesia.delete_schema([node()])
Mnesia.delete_schema([node()])
|> inspect
|> Mix.shell.info
end
end

defmodule Mix.Tasks.BattleSnake.Schema.Create do
defmodule Mix.Tasks.BattleSnake.Schema.Install do
use Mix.Task

@shortdoc "create the mnesia schema on disk"
def run(_) do
Application.ensure_all_started(:mnesia)
:mnesia.change_table_copy_type(:schema, node(), :disc_copies)
|> inspect
|> Mix.shell.info
end
end

defmodule Mix.Tasks.BattleSnake.Schema.Tables.Create do
use Mix.Task

@shortdoc "creates the mnesia database"
def run(_) do
Mnesia.install([node()])
end
Expand Down
3 changes: 1 addition & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ defmodule BattleSnake.Mixfile do

"battle_snake.schema": [
"battle_snake.schema.drop",
"battle_snake.schema.create",
"battle_snake.schema.tables.create"]]
"battle_snake.schema.install"]]
end

defp npm_install(_) do
Expand Down

0 comments on commit 5aab36e

Please sign in to comment.