File size: 696 Bytes
fbbd444
8752997
 
 
 
 
 
 
 
 
 
 
 
fbbd444
 
 
8752997
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Dockerfile
FROM elixir:1.14-alpine

# Install build dependencies
RUN apk add --no-cache build-base npm git python3

# Install hex and rebar
RUN mix local.hex --force && \
    mix local.rebar --force

# Set working directory
WORKDIR /app

# Create necessary directories
RUN mkdir -p priv/static/assets priv/static/images

# Copy mix files
COPY mix.exs mix.lock ./

# Install mix dependencies
RUN mix deps.get

# Copy assets
COPY assets assets
COPY priv priv
COPY config config
COPY lib lib

# Compile the project
RUN mix do compile

# Build assets
RUN cd assets && npm install && npm run deploy
RUN mix phx.digest

ENV MIX_ENV=prod
ENV PORT=7860

# Run the Phoenix app
CMD ["mix", "phx.server"]