2023-07-29 15:45:03 +00:00
|
|
|
FROM elixir:1.14-alpine as build
|
2019-07-31 23:35:14 +00:00
|
|
|
|
2019-08-03 02:28:48 +00:00
|
|
|
ENV MIX_ENV=prod
|
2022-12-10 02:36:21 +00:00
|
|
|
ENV ERL_EPMD_ADDRESS=127.0.0.1
|
2019-07-31 23:35:14 +00:00
|
|
|
|
2023-07-29 15:45:03 +00:00
|
|
|
ARG BUILD_DIR=/opt/akkoma/
|
|
|
|
ARG UID=1000
|
|
|
|
ARG GID=1000
|
2020-01-10 19:09:14 +00:00
|
|
|
|
2023-07-29 15:45:03 +00:00
|
|
|
RUN addgroup -g ${GID} akkoma \
|
|
|
|
&& adduser -u ${UID} -G akkoma -s /bin/sh -D akkoma \
|
|
|
|
&& apk add --no-cache \
|
|
|
|
git \
|
|
|
|
gcc \
|
|
|
|
g++ \
|
|
|
|
musl-dev \
|
|
|
|
make \
|
|
|
|
cmake \
|
|
|
|
file-dev
|
2020-01-10 19:09:14 +00:00
|
|
|
|
2023-07-29 15:45:03 +00:00
|
|
|
WORKDIR ${BUILD_DIR}
|
2019-08-03 02:28:48 +00:00
|
|
|
|
2023-08-03 20:24:06 +00:00
|
|
|
RUN mix local.hex --force \
|
|
|
|
&& mix local.rebar --force
|
|
|
|
|
|
|
|
COPY ./mix.exs ./mix.lock ./
|
|
|
|
|
2023-09-15 22:12:20 +00:00
|
|
|
RUN mix deps.get --only ${MIX_ENV}
|
2023-08-03 20:24:06 +00:00
|
|
|
|
2023-07-29 15:45:03 +00:00
|
|
|
COPY . .
|
|
|
|
|
|
|
|
RUN mkdir -p "${BUILD_DIR}_build/" \
|
|
|
|
&& mix release --path "${BUILD_DIR}_build"
|
|
|
|
|
|
|
|
|
|
|
|
FROM elixir:1.14-alpine as web
|
|
|
|
|
|
|
|
ENV MIX_ENV=prod
|
|
|
|
ENV ERL_EPMD_ADDRESS=127.0.0.1
|
2019-07-31 23:35:14 +00:00
|
|
|
|
2023-07-29 15:45:03 +00:00
|
|
|
ARG DATA_DIR=/var/lib/akkoma/
|
|
|
|
ARG INSTALL_DIR=/opt/akkoma/
|
|
|
|
ARG CONFIG_DIR=/etc/akkoma/
|
2022-10-16 19:25:54 +00:00
|
|
|
ARG UID=1000
|
|
|
|
ARG GID=1000
|
2019-07-31 23:35:14 +00:00
|
|
|
|
2023-07-29 15:45:03 +00:00
|
|
|
RUN addgroup -g ${GID} akkoma \
|
|
|
|
&& adduser -u ${UID} -G akkoma -s /bin/sh -D akkoma \
|
|
|
|
&& apk add --no-cache \
|
|
|
|
exiftool \
|
|
|
|
ffmpeg \
|
|
|
|
imagemagick \
|
|
|
|
libmagic \
|
|
|
|
ncurses \
|
|
|
|
postgresql-client
|
|
|
|
|
|
|
|
RUN mkdir -p "${DATA_DIR}uploads/" \
|
|
|
|
&& mkdir -p "${DATA_DIR}static/" \
|
|
|
|
&& mkdir -p "${INSTALL_DIR}" \
|
|
|
|
&& mkdir -p "${CONFIG_DIR}"
|
|
|
|
|
|
|
|
COPY --from=build ${INSTALL_DIR}_build/ ${INSTALL_DIR}
|
|
|
|
COPY ./docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
2019-08-03 02:28:48 +00:00
|
|
|
|
2023-07-29 15:45:03 +00:00
|
|
|
ENV PATH="/opt/akkoma/bin:${PATH}"
|
2023-08-04 21:09:28 +00:00
|
|
|
ENV AKKOMA_CONFIG_PATH="${CONFIG_DIR}config.exs"
|
2023-07-29 15:45:03 +00:00
|
|
|
|
|
|
|
WORKDIR ${INSTALL_DIR}
|
|
|
|
|
|
|
|
EXPOSE 4000
|
2019-08-03 02:28:48 +00:00
|
|
|
|
2023-07-29 15:45:03 +00:00
|
|
|
ENTRYPOINT [ "docker-entrypoint.sh" ]
|
2019-08-03 02:28:48 +00:00
|
|
|
|
2023-07-29 15:45:03 +00:00
|
|
|
CMD [ "pleroma", "start" ]
|