Basic working Dockerfile

No fancy script or minit automatic migration, etc, but if you start
the docker image and go in and manually do everything, it works.
This commit is contained in:
Ashlynn Anderson 2019-07-31 19:35:14 -04:00
parent e553a17e98
commit 7efca4317b
1 changed files with 32 additions and 0 deletions

32
Dockerfile Normal file
View File

@ -0,0 +1,32 @@
FROM rinpatch/elixir:1.9.0-rc.0-alpine as build
COPY . .
ENV MIX_ENV prod
RUN apk add git gcc g++ musl-dev make &&\
echo "import Mix.Config" > config/prod.secret.exs &&\
mix local.hex --force &&\
mix local.rebar --force
RUN mix deps.get --only prod &&\
mkdir release &&\
mix release --path release
FROM alpine:latest
RUN echo "http://nl.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories &&\
apk update &&\
apk add ncurses postgresql-client
RUN adduser --system --shell /bin/false --home /opt/pleroma pleroma &&\
mkdir -p /var/lib/pleroma/uploads &&\
chown -R pleroma /var/lib/pleroma &&\
mkdir -p /var/lib/pleroma/static &&\
chown -R pleroma /var/lib/pleroma &&\
mkdir -p /etc/pleroma &&\
chown -R pleroma /etc/pleroma
USER pleroma
COPY --from=build --chown=pleroma:0 /release/ /opt/pleroma/