akkoma/Dockerfile
FloatingGhost 93b3f41c76 prepare for ubuntu upgrade
use commit ref

commit sha

select platforms

use official docker image

make sure we specify build ref

test full build

make sure we have g++

make sure we have wget

make sure apt doesn't hang the build

fix deps

skip ubuntu20 for now

skip it

tag the fedora build

fedora deps

make sure env is set

ensure locale

remove --verbose flag

see what happens if i remove hex

what

install mix

why though?

combine one more step

fedora please

add rclone

try fedora 36

just combine them

drop fedora, build musl

remove unneeded quotes

force rm

requote

use untemplated yaml

seperate commands

fix ref

give releasing duty to releasing image

remove scw download

put tag in job

it's not happy with the var

ok this will work somehow

remove quotes

echo them heck it

i hate ci

debug

reset

combine pipelines

check others

build musl on release

use debian image

export tags at runtime

drop musl11, fix build condition
2022-07-27 19:48:52 +01:00

51 lines
1.3 KiB
Docker

FROM elixir:1.13.4-alpine as build
COPY . .
ENV MIX_ENV=prod
RUN apk add git gcc g++ musl-dev make cmake file-dev &&\
echo "import Config" > config/prod.secret.exs &&\
mix local.hex --force &&\
mix local.rebar --force &&\
mix deps.get --only prod &&\
mkdir release &&\
mix release --path release
FROM alpine:3.16
ARG BUILD_DATE
ARG VCS_REF
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
ARG HOME=/opt/akkoma
ARG DATA=/var/lib/akkoma
RUN apk update &&\
apk add exiftool ffmpeg imagemagick libmagic ncurses postgresql-client &&\
adduser --system --shell /bin/false --home ${HOME} akkoma &&\
mkdir -p ${DATA}/uploads &&\
mkdir -p ${DATA}/static &&\
chown -R akkoma ${DATA} &&\
mkdir -p /etc/akkoma &&\
chown -R akkoma /etc/akkoma
USER akkoma
COPY --from=build --chown=akkoma:0 /release ${HOME}
COPY ./config/docker.exs /etc/akkoma/config.exs
COPY ./docker-entrypoint.sh ${HOME}
EXPOSE 4000
ENTRYPOINT ["/opt/akkoma/docker-entrypoint.sh"]