-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.dev
55 lines (39 loc) · 1.09 KB
/
Dockerfile.dev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
ARG ELIXIR_VERSION=1.17.2
ARG OTP_VERSION=27.0.1
ARG DEBIAN_VERSION=bullseye-20240722-slim
ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}"
ARG CLOUD_HYPERVISOR_VERSION=v41.0
FROM ${BUILDER_IMAGE}
# Set development environment
ENV MIX_ENV=dev
##
# Install dependencies
##
RUN apt-get update -y && apt-get install -y build-essential git curl inotify-tools \
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && apt-get install -y nodejs
##
# Prepare app and run it
##
# Set working directory
WORKDIR /app
# Install hex + rebar
RUN mix local.hex --force && \
mix local.rebar --force
# Install Phoenix
RUN mix archive.install hex phx_new --force
# Copy mix files
COPY mix.exs mix.lock ./
# Install mix dependencies
RUN mix deps.get
# Copy config files
COPY config config
# Copy the rest of the application code
COPY . .
# Install npm dependencies
WORKDIR /app/assets
RUN npm install
# Return to the app directory
WORKDIR /app
# Start entrypoint.sh script
ENTRYPOINT ["./entrypoint.sh"]