Initial commit of Keila Cloudron package
This commit is contained in:
51
Dockerfile
51
Dockerfile
@ -1,27 +1,38 @@
|
||||
FROM cloudron/base:4.2.0
|
||||
# Stage 1: Build
|
||||
FROM elixir:1.15-slim AS build
|
||||
|
||||
# Install runtime dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
postgresql-client \
|
||||
supervisor \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
# Install build dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends git npm build-essential cmake
|
||||
|
||||
# Copy entire Keila app and ALL Erlang-related files from official image
|
||||
COPY --from=pentacent/keila:0.14 /opt/app /app/pkg
|
||||
COPY --from=pentacent/keila:0.14 /usr/local /usr/local
|
||||
# Clone Keila repository
|
||||
RUN git clone --depth 1 --branch v0.15.0 https://github.com/pentacent/keila.git /keila
|
||||
WORKDIR /keila
|
||||
|
||||
# Copy configuration files
|
||||
COPY start.sh /app/code/start.sh
|
||||
COPY keila-wrapper.sh /app/code/keila-wrapper.sh
|
||||
COPY supervisor/ /etc/supervisor/conf.d/
|
||||
COPY nginx.conf /etc/nginx/sites-available/default
|
||||
# Install Elixir and NPM dependencies
|
||||
ENV MIX_ENV=prod
|
||||
RUN mix local.hex --force && \
|
||||
mix local.rebar --force && \
|
||||
mix deps.get --only prod && \
|
||||
mix deps.compile
|
||||
|
||||
# Set permissions
|
||||
RUN chmod +x /app/code/start.sh /app/code/keila-wrapper.sh && \
|
||||
chown -R cloudron:cloudron /app/code /app/pkg
|
||||
RUN npm ci --prefix ./assets
|
||||
|
||||
WORKDIR /app/code
|
||||
# Build the release
|
||||
ENV RELEASE_INCLUDE_ERTS=true
|
||||
RUN echo 'config :tzdata, autoupdate: :disabled' >> /keila/config/config.exs
|
||||
RUN mix assets.deploy && \
|
||||
mix release
|
||||
|
||||
EXPOSE 4000
|
||||
# Stage 2: Runtime
|
||||
FROM cloudron/base:5.0.0
|
||||
|
||||
RUN mkdir -p /app/code /app/data
|
||||
|
||||
COPY --from=build /keila/_build/prod/rel/keila /app/code
|
||||
COPY start.sh /app/code/
|
||||
RUN chmod +x /app/code/start.sh
|
||||
|
||||
RUN chown -R cloudron:cloudron /app/code /app/data
|
||||
|
||||
CMD ["/app/code/start.sh"]
|
||||
|
||||
CMD ["/app/code/start.sh"]
|
Reference in New Issue
Block a user