Restore from bare metal to Docker

Hello, I’d like to migrate my bare-metal OTP Akkoma 3.5.0 to a Docker-based one.
I’ve followed the relevant instructions and I’ve ended up with:

  • an akkoma_akkoma_1 container
  • an akkoma_db_1 container
  • a prod.secret.exs file under the config/ subdir of the git repo
  • a setup_db.psql file under the config/ subdir of the git repo

After that, following these other instructions I’ve performed the required pg_dump and copied that and /etc/akkoma/config.exs and the entire /var/lib/akkoma/uploads directory to the Docker host.

First problem: how should I merge the config files?
Under config :pleroma, Pleroma.Web.Endpoint section, which are the values of secret_key_base, live_view, signing_salt to be used?
For the Postgres section, I suppose that it’s possible to keep the Docker-based values, as well as for rum_enabled, static_dir, uploads
Under config :web_push_encryption, :vapid_details, should I use the original public_key and private_key values or the Docker-based ones?
For the config :joken, default_signer: value, which one should I use?

Thanks in advance

PS: BTW, on my original instance (running Debian 11) I’ve installed the PostgreSQL RUM extension (via OS package) and proceeded to enable it for Akkoma’s DB.
Now, the Docker version is… not so collaborative when it comes to install the same extension (it requires an update to the docker-resources/database/Dockerfile, and still didn’t work).

you’re following the install guide, Migrating to a Docker Installation - Akkoma Documentation is more what you’re after

1 Like

Thanks!
Just a little warning about using PostgreSQL’s RUM indexes: if you’re doing so, and you decide to migrate to Docker, you’ll need to modify your Dockerfile(s) first.

# docker-resources/database/Dockerfile
FROM postgres:15.1-alpine3.17

ARG UID=1000
ARG GID=1000
ARG UNAME=akkoma

# installing RUM extension
RUN apk update && apk --upgrade add postgresql-rum && \
 cp /usr/lib/postgresql15/rum.so /usr/local/lib/postgresql/ && \
 cp /usr/share/postgresql15/extension/rum* /usr/local/share/postgresql/extension/

RUN addgroup -g $GID $UNAME
RUN adduser -u $UID -G $UNAME -D -h $HOME $UNAME

USER akkoma

I’ve upgraded the PostgreSQL server version because, for Alpine 3.17, the OS package postgresql-rum installs the version compiled with PostgreSQL 15.

# Dockerfile
FROM hexpm/elixir:1.13.4-erlang-24.3.4.5-alpine-3.17.0

ENV MIX_ENV=prod
ENV ERL_EPMD_ADDRESS=127.0.0.1

ARG HOME=/opt/akkoma

LABEL org.opencontainers.image.title="akkoma" \
    org.opencontainers.image.description="Akkoma for Docker" \
    org.opencontainers.image.vendor="akkoma.dev" \
    org.opencontainers.image.documentation="https://docs.akkoma.dev/stable/" \
    org.opencontainers.image.licenses="AGPL-3.0" \
    org.opencontainers.image.url="https://akkoma.dev" \
    org.opencontainers.image.revision=$VCS_REF \
    org.opencontainers.image.created=$BUILD_DATE

RUN apk add git gcc g++ musl-dev make cmake file-dev exiftool ffmpeg imagemagick libmagic ncurses postgresql-client

EXPOSE 4000

ARG UID=1000
ARG GID=1000
ARG UNAME=akkoma

RUN addgroup -g $GID $UNAME
RUN adduser -u $UID -G $UNAME -D -h $HOME $UNAME

WORKDIR /opt/akkoma

USER $UNAME
RUN mix local.hex --force &&\
    mix local.rebar --force

CMD ["/opt/akkoma/docker-entrypoint.sh"]

Here, I’ve bumped up the Alpine OS version while maintaining everything else the same, to ensure that the PostgreSQL client package version is the same of the server’s