Fix the Dockerfile
This commit is contained in:
parent
6ecb09d0fb
commit
246f0df88e
2 changed files with 27 additions and 21 deletions
26
Dockerfile
26
Dockerfile
|
@ -1,22 +1,28 @@
|
||||||
FROM elixir:1.9-alpine as build
|
FROM ubuntu:22.04 as build
|
||||||
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
ENV MIX_ENV=prod
|
ENV MIX_ENV=prod
|
||||||
|
WORKDIR /src
|
||||||
|
|
||||||
RUN apk add git gcc g++ musl-dev make cmake file-dev &&\
|
RUN apt-get update &&\
|
||||||
echo "import Mix.Config" > config/prod.secret.exs &&\
|
apt-get install -y git elixir erlang-dev erlang-nox build-essential cmake libssl-dev libmagic-dev automake autoconf libncurses5-dev &&\
|
||||||
mix local.hex --force &&\
|
mix local.hex --force &&\
|
||||||
mix local.rebar --force &&\
|
mix local.rebar --force
|
||||||
|
|
||||||
|
COPY . /src
|
||||||
|
|
||||||
|
RUN cd /src &&\
|
||||||
mix deps.get --only prod &&\
|
mix deps.get --only prod &&\
|
||||||
mkdir release &&\
|
mkdir release &&\
|
||||||
mix release --path release
|
mix release --path release
|
||||||
|
|
||||||
FROM alpine:3.14
|
FROM ubuntu:22.04
|
||||||
|
|
||||||
ARG BUILD_DATE
|
ARG BUILD_DATE
|
||||||
ARG VCS_REF
|
ARG VCS_REF
|
||||||
|
|
||||||
|
ARG DEBIAN_FRONTEND="noninteractive"
|
||||||
|
ENV TZ="Etc/UTC"
|
||||||
|
|
||||||
LABEL maintainer="ops@pleroma.social" \
|
LABEL maintainer="ops@pleroma.social" \
|
||||||
org.opencontainers.image.title="pleroma" \
|
org.opencontainers.image.title="pleroma" \
|
||||||
org.opencontainers.image.description="Pleroma for Docker" \
|
org.opencontainers.image.description="Pleroma for Docker" \
|
||||||
|
@ -31,8 +37,8 @@ LABEL maintainer="ops@pleroma.social" \
|
||||||
ARG HOME=/opt/pleroma
|
ARG HOME=/opt/pleroma
|
||||||
ARG DATA=/var/lib/pleroma
|
ARG DATA=/var/lib/pleroma
|
||||||
|
|
||||||
RUN apk update &&\
|
RUN apt-get update &&\
|
||||||
apk add exiftool ffmpeg imagemagick libmagic ncurses postgresql-client &&\
|
apt-get install -y --no-install-recommends imagemagick libmagic-dev ffmpeg libimage-exiftool-perl libncurses5 postgresql-client &&\
|
||||||
adduser --system --shell /bin/false --home ${HOME} pleroma &&\
|
adduser --system --shell /bin/false --home ${HOME} pleroma &&\
|
||||||
mkdir -p ${DATA}/uploads &&\
|
mkdir -p ${DATA}/uploads &&\
|
||||||
mkdir -p ${DATA}/static &&\
|
mkdir -p ${DATA}/static &&\
|
||||||
|
@ -42,7 +48,7 @@ RUN apk update &&\
|
||||||
|
|
||||||
USER pleroma
|
USER pleroma
|
||||||
|
|
||||||
COPY --from=build --chown=pleroma:0 /release ${HOME}
|
COPY --from=build --chown=pleroma:0 /src/release ${HOME}
|
||||||
|
|
||||||
COPY ./config/docker.exs /etc/pleroma/config.exs
|
COPY ./config/docker.exs /etc/pleroma/config.exs
|
||||||
COPY ./docker-entrypoint.sh ${HOME}
|
COPY ./docker-entrypoint.sh ${HOME}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/ash
|
#!/bin/bash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue