-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
49 lines (39 loc) · 1.11 KB
/
Dockerfile
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
FROM elixir:1.16-alpine
# Install build dependencies
RUN apk update && \
apk upgrade --no-cache && \
apk add --no-cache \
build-base \
gcc \
git \
make \
libc-dev \
bash \
inotify-tools \
postgresql-client \
erlang-dev
# Set the working directory inside the container
WORKDIR /app
# Install hex, rebar, and the Phoenix framework itself
RUN mix local.hex --force && \
mix local.rebar --force && \
mix archive.install hex phx_new 1.5.9 --force
# Copy over all the necessary application files and directories
COPY config/ config/
COPY lib/ lib/
COPY priv/ priv/
COPY assets/ assets/
COPY mix.exs .
COPY mix.lock .
# Fetch the application dependencies and compile the app
RUN mix do deps.get, deps.compile, compile
# Digest the static assets
RUN mix phx.digest
# Copy the entrypoint script to the container
COPY entrypoint.sh /app/entrypoint.sh
# Make the script executable
RUN chmod +x /app/entrypoint.sh
# Expose port 4000 for the app
EXPOSE 4000
# Use the entrypoint script to run migrations and then start the Phoenix server
ENTRYPOINT ["/app/entrypoint.sh"]