File tree 4 files changed +43
-19
lines changed
4 files changed +43
-19
lines changed Original file line number Diff line number Diff line change
1
+ # The directory Mix will write compiled artifacts to.
2
+ /_build /
3
+
4
+ # If you run "mix test --cover", coverage assets end up here.
5
+ /cover /
6
+
7
+ # The directory Mix downloads your dependencies sources to.
8
+ /deps /
9
+
10
+ # Where 3rd-party dependencies like ExDoc output generated docs.
11
+ /doc /
12
+
13
+ # Ignore .fetch files in case you like to edit your project deps locally.
14
+ /.fetch
15
+
16
+ # If the VM crashes, it generates a dump, let's ignore it too.
17
+ erl_crash.dump
18
+
19
+ # Also ignore archive artifacts (built via "mix archive.build").
20
+ * .ez
21
+
22
+ # Ignore package tarball (built via "mix hex.build").
23
+ todo_backend- * .tar
24
+
25
+ # Since we are building assets from assets/,
26
+ # we ignore priv/static. You may want to comment
27
+ # this depending on your deployment strategy.
28
+ /priv /static /
29
+
30
+ npm-debug.log
31
+ /assets /node_modules
32
+ * .beam
33
+ .elixir_ls /
Original file line number Diff line number Diff line change 1
1
FROM elixir:1.9.0
2
2
ENV DEBIAN_FRONTEND=noninteractive
3
3
ENV MIX_HOME=/opt/mix
4
+ # Compile elixir files for production
5
+ ENV MIX_ENV prod
4
6
5
7
# Install hex
6
8
RUN mix local.hex --force
@@ -28,9 +30,13 @@ RUN mkdir -p $APP_HOME
28
30
ADD . $APP_HOME
29
31
WORKDIR $APP_HOME
30
32
31
- EXPOSE 4000
33
+ RUN mix deps.get
34
+
35
+ RUN mix compile \
36
+ && mix phx.digest
32
37
33
38
RUN useradd -m myuser
34
39
USER myuser
35
40
36
- CMD ["mix" , "phx.server" ]
41
+
42
+ CMD MIX_ENV=prod mix phx.server
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ services:
10
10
ports :
11
11
- " 82:80"
12
12
web :
13
- build : .
13
+ image : docker.io/geegog/docker-phoenix
14
14
environment :
15
15
- MIX_ENV=dev
16
16
- PORT=4000
@@ -24,7 +24,7 @@ services:
24
24
networks :
25
25
- my-network
26
26
test :
27
- build : .
27
+ image : docker.io/geegog/docker-phoenix
28
28
command : mix test
29
29
environment :
30
30
- MIX_ENV=test
You can’t perform that action at this time.
0 commit comments