Skip to content

Commit 047629c

Browse files
authored
Merge pull request #13 from Lgdev07/fix/empty-state-handling
Fix/empty state handling
2 parents 38a9fab + d3d9c76 commit 047629c

File tree

18 files changed

+3447
-1336
lines changed

18 files changed

+3447
-1336
lines changed

.github/workflows/elixir.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ jobs:
1010
- name: Checkout
1111
uses: actions/checkout@v2
1212

13+
- name: Set up Docker Compose
14+
run: |
15+
sudo apt-get update
16+
sudo apt-get install -y docker-compose
17+
1318
- name: Build Docker image
1419
run: docker build --build-arg MIX_ENV=test --tag code_comparison:latest .
1520

@@ -22,9 +27,6 @@ jobs:
2227
- name: Format
2328
run: docker exec web mix format --check-formatted
2429

25-
- name: Credo
26-
run: docker exec web mix credo --strict
27-
2830
- name: Test
2931
run: docker exec web mix test
3032

Dockerfile

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,56 @@
1-
FROM hexpm/elixir:1.11.4-erlang-23.2.7.2-alpine-3.13.3 AS base
1+
FROM elixir:1.18.3-otp-27-slim AS base
22

33
WORKDIR /code_comparison
44

5+
RUN apt-get update && \
6+
apt-get install -y npm inotify-tools ca-certificates curl bash git && \
7+
apt-get clean && \
8+
rm -rf /var/lib/apt/lists/*
9+
510
RUN mix do local.hex --force, local.rebar --force
611

7-
RUN apk add npm inotify-tools
12+
# -----------------
13+
# BUILD
14+
# -----------------
15+
FROM base AS build
16+
17+
ARG MIX_ENV=prod
18+
ARG SECRET_KEY_BASE=dummy_secret
19+
ENV MIX_ENV=$MIX_ENV
20+
ENV SECRET_KEY_BASE=$SECRET_KEY_BASE
21+
22+
COPY . ./
23+
24+
# install application
25+
RUN mix do deps.get, compile
26+
27+
# -----------------
28+
# RELEASE
29+
# -----------------
30+
FROM build AS release
31+
32+
# Build static assets and digest them
33+
RUN npm install --prefix assets && npm run deploy --prefix assets && mix phx.digest
34+
35+
# generate release executable
36+
RUN mix release
37+
38+
# -----------------
39+
# PRODUCTION
40+
# -----------------
41+
FROM elixir:1.18.3-otp-27-slim AS production
42+
43+
WORKDIR /code_comparison
44+
45+
ARG MIX_ENV=prod
46+
47+
# install dependencies
48+
RUN apt-get update && \
49+
apt-get install -y ncurses-bin curl && \
50+
apt-get clean && \
51+
rm -rf /var/lib/apt/lists/*
52+
53+
COPY --from=release /code_comparison/_build/$MIX_ENV/rel/code_comparison ./
54+
COPY --from=build /code_comparison/topics ./topics
55+
56+
CMD ["bin/code_comparison", "start"]

0 commit comments

Comments
 (0)