Compare commits

..

No commits in common. "master" and "v2.7.0" have entirely different histories.

4 changed files with 38 additions and 13 deletions

10
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "monthly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"

View File

@ -39,6 +39,7 @@ jobs:
context: .
platforms: |
linux/amd64
linux/arm64
tags: |
${{env.VERSION_TAG}}
${{env.LASTEST_TAG}}

17
.github/workflows/linter.yml vendored Normal file
View File

@ -0,0 +1,17 @@
---
name: Lint Code Base
on: push
jobs:
build:
name: Lint Code Base
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Lint Code Base
uses: docker://github/super-linter:v2.2.2
env:
VALIDATE_ENV: false

View File

@ -1,44 +1,41 @@
FROM elixir:1.16.3-alpine
FROM elixir:1.15.8-otp-24-alpine
ARG PLEROMA_VER=stable
ARG UID=911
ARG GID=911
ENV MIX_ENV=prod
# 更新并安装必要的依赖
RUN apk update && \
RUN apk update && apk upgrade && \
apk add --no-cache \
git gcc g++ musl-dev make cmake file-dev \
exiftool imagemagick libmagic ncurses \
postgresql-client ffmpeg openssl-dev
postgresql-client ffmpeg
# 创建用户和组
RUN addgroup -g ${GID} pleroma && \
adduser -h /pleroma -s /bin/false -D -G pleroma -u ${UID} pleroma
# 创建必要的目录并设置权限
ARG DATA=/var/lib/pleroma
RUN mkdir -p /etc/pleroma ${DATA}/uploads ${DATA}/static && \
chown -R pleroma:pleroma /etc/pleroma ${DATA}
# 切换到 pleroma 用户
USER pleroma
WORKDIR /pleroma
# 克隆 Pleroma 仓库并切换到指定版本
RUN git clone -b stable https://git.pleroma.social/pleroma/pleroma.git . && \
git checkout ${PLEROMA_VER} && \
echo "import Mix.Config" > config/prod.secret.exs && \
mix local.hex --force && \
git checkout ${PLEROMA_VER}
# 配置 Mix 并构建 Release
RUN echo "import Mix.Config" > config/prod.secret.exs
# 逐步安装依赖并构建 Release
RUN mix local.hex --force && \
mix local.rebar --force && \
mix deps.get --only prod && \
mix release --path /pleroma
# 复制配置文件
COPY ./config.exs /etc/pleroma/config.exs
# 暴露端口
EXPOSE 4000
# 设置入口点
ENTRYPOINT ["/pleroma/docker-entrypoint.sh"]