Migrate to alpine linux

wew that was easy
This commit is contained in:
sn0w 2019-01-10 19:03:52 +01:00
parent a02f0a4d67
commit 2acfbc8842
No known key found for this signature in database
GPG Key ID: DDEDFB9D3FA15727
3 changed files with 15 additions and 17 deletions

View File

@ -1,10 +1,9 @@
FROM debian:9-slim FROM alpine:3.8
# Set up environment # Set up environment
ENV MIX_ENV=prod
ENV DEBIAN_FRONTEND=noninteractive
ENV LC_ALL=C.UTF-8 ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8 ENV LANG=C.UTF-8
ENV MIX_ENV=prod
# Prepare mounts # Prepare mounts
VOLUME /custom.d VOLUME /custom.d
@ -12,18 +11,16 @@ VOLUME /custom.d
# Expose default pleroma port to host # Expose default pleroma port to host
EXPOSE 4000 EXPOSE 4000
# Get erlang, elixir, and dependencies # Get dependencies
RUN \ RUN \
apt-get update \ apk add --no-cache --virtual .tools \
&& apt-get install -y --no-install-recommends apt-utils \ git curl \
&& apt-get install -y --no-install-recommends git wget ca-certificates gnupg2 build-essential ruby \
\ \
&& wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb \ && apk add --no-cache --virtual .sdk \
&& dpkg -i erlang-solutions_1.0_all.deb \ build-base \
&& apt-get update \
&& apt-get install -y --no-install-recommends esl-erlang elixir \
\ \
&& rm -rf /var/lib/apt/lists/* && apk add --no-cache --virtual .runtime \
erlang erlang-runtime-tools erlang-xmerl elixir
# Add entrypoint # Add entrypoint
COPY ./entrypoint.sh / COPY ./entrypoint.sh /
@ -36,8 +33,8 @@ ARG DOCKER_GID=1000
ARG PLEROMA_UPLOADS_PATH=/uploads ARG PLEROMA_UPLOADS_PATH=/uploads
RUN \ RUN \
groupadd --gid ${DOCKER_GID} pleroma \ addgroup --gid ${DOCKER_GID} pleroma \
&& useradd -m -s /bin/bash --gid ${DOCKER_GID} --uid ${DOCKER_UID} pleroma \ && adduser -S -s /bin/ash -G pleroma -u ${DOCKER_UID} pleroma \
&& mkdir -p /custom.d $PLEROMA_UPLOADS_PATH \ && mkdir -p /custom.d $PLEROMA_UPLOADS_PATH \
&& chown -R pleroma:pleroma /custom.d $PLEROMA_UPLOADS_PATH && chown -R pleroma:pleroma /custom.d $PLEROMA_UPLOADS_PATH

View File

@ -37,7 +37,7 @@ or guides from the community. A few are linked below. This list is not exhaustiv
### Prerequisites ### Prerequisites
- 1-2GB of free HDD space (yeah it sucks, Alpine Linux soontm) - 500mb of free HDD space
- `m4` and `awk` in remotely recent versions - `m4` and `awk` in remotely recent versions
- `curl` or `wget` if you want smarter build caches and commands like `./pleroma mod` - `curl` or `wget` if you want smarter build caches and commands like `./pleroma mod`
- `jq` and `dialog` if you want to use `./pleroma mod` - `jq` and `dialog` if you want to use `./pleroma mod`

View File

@ -1,9 +1,10 @@
#!/bin/bash #!/bin/ash
# shellcheck shell=dash
set -e set -e
set -x set -x
if [[ -n "$BUILDTIME" ]]; then if [ -n "$BUILDTIME" ]; then
mix local.rebar --force mix local.rebar --force
mix local.hex --force mix local.hex --force