social media crossposting tool. 3rd time's the charm
mastodon misskey crossposting bluesky
at master 1.0 kB view raw
1FROM python:3.12-alpine 2COPY --from=ghcr.io/astral-sh/uv:0.7.12 /uv /uvx /bin/ 3 4# Install build tools & runtime dependencies 5RUN apk add --no-cache \ 6 ffmpeg \ 7 file \ 8 libmagic 9 10RUN mkdir -p /app/data 11WORKDIR /app 12 13# switch to a non-root user 14RUN adduser -D -u 1000 app && \ 15 chown -R app:app /app 16USER app 17 18# Enable bytecode compilation 19ENV UV_COMPILE_BYTECODE=1 20 21# Copy from the cache instead of linking since it's a mounted volume 22ENV UV_LINK_MODE=copy 23 24# Install the project's dependencies using the lockfile and settings 25COPY ./uv.lock ./pyproject.toml /app/ 26RUN --mount=type=cache,target=/root/.cache/uv \ 27 uv sync --locked --no-install-project --no-dev 28 29# Define app data volume 30VOLUME /app/data 31 32# Then, add the rest of the project source code and install it 33COPY . /app 34RUN --mount=type=cache,target=/root/.cache/uv \ 35 uv sync --locked --no-dev 36 37# Place executables in the environment at the front of the path 38ENV PATH="/app/.venv/bin:$PATH" 39 40# Set entrypoint to run the app using uv 41ENTRYPOINT ["uv", "run", "main.py"]