add (non-working so far) dockerfile
This commit is contained in:
parent
dd6e7cf73f
commit
cd7a5431e9
4 changed files with 82 additions and 0 deletions
30
Dockerfile
Normal file
30
Dockerfile
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
FROM docker.io/python:3.11-alpine as python-base
|
||||||
|
|
||||||
|
ENV POETRY_VERSION=1.3.2
|
||||||
|
ENV POETRY_HOME=/opt/poetry
|
||||||
|
ENV POETRY_VENV=/opt/poetry-venv
|
||||||
|
ENV POETRY_CACHE_DIR=/opt/.cache
|
||||||
|
|
||||||
|
RUN apk add --no-cache tini libmagic libpq vips vips-dev
|
||||||
|
|
||||||
|
FROM python-base as poetry-base
|
||||||
|
|
||||||
|
RUN python3 -m venv $POETRY_VENV \
|
||||||
|
&& $POETRY_VENV/bin/pip install -U pip setuptools \
|
||||||
|
&& $POETRY_VENV/bin/pip install poetry==${POETRY_VERSION} \
|
||||||
|
&& $POETRY_VENV/bin/pip install poethepoet
|
||||||
|
|
||||||
|
FROM python-base as app
|
||||||
|
|
||||||
|
COPY --from=poetry-base ${POETRY_VENV} ${POETRY_VENV}
|
||||||
|
ENV PATH="${PATH}:${POETRY_VENV}/bin"
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY poetry.lock pyproject.toml ./
|
||||||
|
RUN poetry install --no-interaction --no-cache --without dev
|
||||||
|
|
||||||
|
COPY . /app
|
||||||
|
|
||||||
|
ENTRYPOINT ["/sbin/tini", "--"]
|
||||||
|
CMD ["sh", "./entry.sh"]
|
11
README.md
11
README.md
|
@ -1 +1,12 @@
|
||||||
# pronouns.cc
|
# pronouns.cc
|
||||||
|
|
||||||
|
pronouns.cc rewrite in Python, using Quart for routing, SQLAlchemy for the database, and Celery for background tasks.
|
||||||
|
|
||||||
|
## Running
|
||||||
|
|
||||||
|
This isn't anywhere *near* complete yet. For now, you can install [`poe`](https://github.com/nat-n/poethepoet),
|
||||||
|
run `poe migrate`, and then `poe server`.
|
||||||
|
|
||||||
|
For configuration, a `.env` file is used. See `foxnouns/settings.py`--all keys are required unless specified otherwise.
|
||||||
|
|
||||||
|
(Note that the docker-compose file doesn't work yet)
|
||||||
|
|
36
docker-compose.yml
Normal file
36
docker-compose.yml
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
image: foxnouns
|
||||||
|
build: .
|
||||||
|
environment:
|
||||||
|
- DATABASE_USER=postgres
|
||||||
|
- DATABASE_PASSWORD=postgres
|
||||||
|
- DATABASE_HOST=postgres
|
||||||
|
- DATABASE_NAME=postgres
|
||||||
|
volumes:
|
||||||
|
- "./.env:/app/.env"
|
||||||
|
ports:
|
||||||
|
- "8000:8000"
|
||||||
|
networks:
|
||||||
|
- default
|
||||||
|
|
||||||
|
postgres:
|
||||||
|
image: docker.io/postgres:15-alpine
|
||||||
|
volumes:
|
||||||
|
- "postgres_data:/var/lib/postgresql/data"
|
||||||
|
command: ["postgres",
|
||||||
|
"-c", "max-connections=1000",
|
||||||
|
"-c", "timezone=Etc/UTC",
|
||||||
|
"-c", "max_wal_size=1GB",
|
||||||
|
"-c", "min_wal_size=80MB",
|
||||||
|
"-c", "shared_buffers=128MB"]
|
||||||
|
environment:
|
||||||
|
- "POSTGRES_PASSWORD=postgres"
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- default
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
postgres_data:
|
5
entry.sh
Normal file
5
entry.sh
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/sh
|
||||||
|
source .env
|
||||||
|
# poetry run alembic upgrade head
|
||||||
|
# poetry run uvicorn --workers=${WORKERS:-2} --host=0.0.0.0 --port=8000 'foxnouns.app:app'
|
||||||
|
poe migrate && poe server
|
Loading…
Reference in a new issue