diff --git a/.dockerignore b/.dockerignore index 03fe1ff9..58c4ce77 100644 --- a/.dockerignore +++ b/.dockerignore @@ -20,7 +20,4 @@ ui/.next/ ui/out/ # deps -ui/node_modules/ - -### misc -.DS_Store \ No newline at end of file +ui/node_modules/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 60fbfedd..4cee58af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ ARG ELIXIR_VERSION=1.14 ARG NODE_VERSION=20.2.0 FROM node:${NODE_VERSION}-alpine AS node -FROM elixir:${ELIXIR_VERSION}-alpine +FROM elixir:${ELIXIR_VERSION}-alpine AS setup ### Install deps @@ -47,6 +47,10 @@ EXPOSE 3000 EXPOSE 4000 ENV PORT=4000 UI_PORT=3000 MIX_ENV=dev +# Create a new stage so that local dev setup can stop here +# Local dev mounts into the container so there's no point in adding/compiling +FROM setup AS compile + ### Install dependencies and compile # Download and compile server deps diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index d90021d5..8ecf2178 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -1,6 +1,11 @@ version: "3" services: web: + build: + context: ./ + target: setup command: sleep infinity + depends_on: + - db volumes: - .:/app diff --git a/server/.gitignore b/server/.gitignore index a725e65a..bd4de1c5 100644 --- a/server/.gitignore +++ b/server/.gitignore @@ -1,30 +1,29 @@ -# App artifacts -/_build -/db -/deps -/*.ez +# The directory Mix will write compiled artifacts to. +/_build/ -/rel +# If you run "mix test --cover", coverage assets end up here. +/cover/ -node_modules/ +# The directory Mix downloads your dependencies sources to. +/deps/ -.vscode/ +# Where 3rd-party dependencies like ExDoc output generated docs. +/doc/ -# Generated on crash by the VM +# Ignore .fetch files in case you like to edit your project deps locally. +/.fetch + +# If the VM crashes, it generates a dump, let's ignore it too. erl_crash.dump -# Files matching config/*.secret.exs pattern contain sensitive -# data and you should not commit them into version control. -# -# Alternatively, you may comment the line below and commit the -# secrets files as long as you replace their contents by environment -# variables. -/config/*.secret.exs +# Also ignore archive artifacts (built via "mix archive.build"). +*.ez # Temporary files, for example, from tests. /tmp/ -assets/src/config/ +# Ignore package tarball (built via "mix hex.build"). +hello-*.tar # Ignore assets that are produced by build tools. /priv/static/assets/ @@ -32,13 +31,6 @@ assets/src/config/ # Ignore digested assets cache. /priv/static/cache_manifest.json -# Webstorm -.idea/ - -bash / - -docker/ - -*.log - -.elixir_ls/ \ No newline at end of file +# In case you use Node.js/npm, you want to ignore these. +npm-debug.log +/assets/node_modules/