Skip to content

Commit a4993f4

Browse files
committed
Added docker dev env
1 parent 381fb63 commit a4993f4

File tree

3 files changed

+129
-0
lines changed

3 files changed

+129
-0
lines changed

.dockerignore

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# This file excludes paths from the Docker build context.
2+
#
3+
# By default, Docker's build context includes all files (and folders) in the
4+
# current directory. Even if a file isn't copied into the container it is still sent to
5+
# the Docker daemon.
6+
#
7+
# There are multiple reasons to exclude files from the build context:
8+
#
9+
# 1. Prevent nested folders from being copied into the container (ex: exclude
10+
# /assets/node_modules when copying /assets)
11+
# 2. Reduce the size of the build context and improve build time (ex. /build, /deps, /doc)
12+
# 3. Avoid sending files containing sensitive information
13+
#
14+
# More information on using .dockerignore is available here:
15+
# https://docs.docker.com/engine/reference/builder/#dockerignore-file
16+
17+
.dockerignore
18+
19+
# Ignore .fetch files in case you like to edit your project deps locally.
20+
.fetch
21+
22+
# Ignore package tarball (built via "mix hex.build").
23+
qr_code-*.tar
24+
25+
# If NPM crashes, it generates a log, let's ignore it too.
26+
npm-debug.log
27+
28+
# The directory NPM downloads your dependencies sources to.
29+
assets/node_modules/
30+
31+
# Since we are building assets from assets/,
32+
# we ignore priv/static. You may want to comment
33+
# this depending on your deployment strategy.
34+
priv/static/
35+
/priv/static/assets/
36+
/priv/static/cache_manifest.json
37+
38+
# Ignore dialyzer tables
39+
priv/plts/*.plt
40+
priv/plts/*.plt.hash
41+
42+
# Ignore git, but keep git HEAD and refs to access current commit hash if needed:
43+
#
44+
# $ cat .git/HEAD | awk '{print ".git/"$2}' | xargs cat
45+
# d0b8727759e1e0e7aa3d41707d12376e373d5ecc
46+
.git
47+
!.git/HEAD
48+
!.git/refs
49+
.github/
50+
.gitignore
51+
52+
# Common development/test artifacts
53+
/cover/
54+
/doc/
55+
/test/
56+
/tmp/
57+
.elixir_ls
58+
59+
# Mix artifacts
60+
/_build/
61+
/deps/
62+
*.ez
63+
64+
# Generated on crash by the VM
65+
erl_crash.dump
66+
67+
# Backup
68+
*~
69+
70+
/tmp/
71+
/.env/
72+
.env*
73+
.vimrc
74+
.projections.json
75+
.editorconfig
76+
.bumpversion.cfg
77+
.vscode/
78+
README*
79+
80+
# tags
81+
tags
82+
tags.*
83+
*.tags
84+
85+
.DS_Store
86+
87+
# docker
88+
Dockerfile

Dockerfile

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM elixir:1.14
2+
3+
RUN apt update -y \
4+
&& apt install -y \
5+
inotify-tools
6+
7+
RUN mix local.rebar --force \
8+
&& mix local.hex --force
9+
10+
COPY mix.exs /usr/src/app/
11+
COPY mix.lock /usr/src/app/
12+
WORKDIR /usr/src/app
13+
RUN mix do deps.get, deps.compile
14+
15+
COPY . /usr/src/app
16+
RUN mix compile
17+
18+
CMD ["iex", "-S", "mix"]

docker-compose.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
version: '3'
2+
services:
3+
qr_code:
4+
image: qrcode:dev
5+
build:
6+
context: .
7+
dockerfile: Dockerfile
8+
volumes:
9+
- ./tmp/erlang-history:/root/.cache/erlang-history
10+
- ./config:/usr/src/app/config
11+
- ./lib:/usr/src/app/lib
12+
- ./priv:/usr/src/app/priv
13+
- ./mix.exs:/usr/src/app/mix.exs
14+
- ./mix.lock:/usr/src/app/mix.lock
15+
- ./test:/usr/src/app/test
16+
- elixir_build:/usr/src/app/_build
17+
- elixir_deps:/usr/src/app/deps
18+
- elixir_dialyzer:/usr/src/app/priv/plts
19+
20+
volumes:
21+
elixir_build:
22+
elixir_deps:
23+
elixir_dialyzer:

0 commit comments

Comments
 (0)