Consolidate and organize config files (#61)

This commit is contained in:
Michael Plunkett
2025-03-03 08:10:23 -06:00
committed by GitHub
parent 9529784fa2
commit 85cec9fbb9
6 changed files with 17 additions and 15 deletions

22
docker/web/Dockerfile Normal file
View File

@@ -0,0 +1,22 @@
# Stage 1: install dependencies
FROM python:3.10-slim AS build
WORKDIR /aa-api
# TODO: multistage build
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
gcc \
g++ \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir poetry
COPY ../../pyproject.toml ../../poetry.lock ../../README.md ./
RUN poetry install --with web --no-interaction --no-ansi --no-cache
# Copy the application code and configurations
COPY ../../alembic.ini ./
COPY ../../app ./app/
COPY ../../user-groups.* ./app/
# Run the FastAPI app with Uvicorn
ENTRYPOINT ["poetry", "run"]

33
docker/worker/Dockerfile Normal file
View File

@@ -0,0 +1,33 @@
# From python:3.10
FROM bellingcat/auto-archiver:v0.13.4
# set work directory
WORKDIR /aa-api
RUN curl -fsSL https://get.docker.com -o get-docker.sh && \
sh get-docker.sh
# set environment variables
ENV LANG=C.UTF-8 \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1
# install dependencies
RUN apt update -y && \
apt install -y python3-venv && \
python3 -m venv ./poetry-venv && \
./poetry-venv/bin/python -m pip install --upgrade pip && \
./poetry-venv/bin/python -m pip install "poetry>=2.0.0,<3.0.0"
COPY ../../pyproject.toml ../../poetry.lock ./
RUN ./poetry-venv/bin/poetry install --without dev --no-root --no-cache
# install dependencies
# copy source code and .env files over
COPY ../../alembic.ini ./
COPY ../../app ./app/
COPY ../../user-groups.* ./app/
ENTRYPOINT ["./poetry-venv/bin/poetry", "run"]