mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-25 08:41:00 +00:00
Update docker-compose and instructions
This commit is contained in:
parent
0f77f0ba96
commit
bc54e1856c
3 changed files with 52 additions and 29 deletions
6
Makefile
6
Makefile
|
@ -6,5 +6,11 @@ image:
|
||||||
docs:
|
docs:
|
||||||
cd docs/ && make html
|
cd docs/ && make html
|
||||||
|
|
||||||
|
compose_build:
|
||||||
|
docker-compose -f docker/docker-compose.yml build
|
||||||
|
|
||||||
compose_up:
|
compose_up:
|
||||||
docker-compose -f docker/docker-compose.yml up
|
docker-compose -f docker/docker-compose.yml up
|
||||||
|
|
||||||
|
compose_down:
|
||||||
|
docker-compose -f docker/docker-compose.yml down
|
||||||
|
|
|
@ -12,11 +12,11 @@ x-takahe-common:
|
||||||
|
|
||||||
image: takahe:latest
|
image: takahe:latest
|
||||||
environment:
|
environment:
|
||||||
TAKAHE_DATABASE_URL: "postgres://postgres:insecure_password@db/takahe"
|
TAKAHE_DATABASE_SERVER: "postgres://postgres:insecure_password@db/takahe"
|
||||||
TAKAHE_DEBUG: true
|
TAKAHE_DEBUG: "true"
|
||||||
TAKAHE_SECRET_KEY: "insecure_secret"
|
TAKAHE_SECRET_KEY: "insecure_secret"
|
||||||
TAKAHE_CSRF_TRUSTED_ORIGINS: '["http://127.0.0.1:8000", "https://127.0.0.1:8000"]'
|
TAKAHE_CSRF_TRUSTED_ORIGINS: '["http://127.0.0.1:8000", "https://127.0.0.1:8000"]'
|
||||||
TAKAHE_USE_PROXY_HEADERS: true
|
TAKAHE_USE_PROXY_HEADERS: "true"
|
||||||
TAKAHE_EMAIL_BACKEND: "console://console"
|
TAKAHE_EMAIL_BACKEND: "console://console"
|
||||||
TAKAHE_MAIN_DOMAIN: "example.com"
|
TAKAHE_MAIN_DOMAIN: "example.com"
|
||||||
TAKAHE_ENVIRONMENT: "development"
|
TAKAHE_ENVIRONMENT: "development"
|
||||||
|
@ -31,7 +31,7 @@ x-takahe-common:
|
||||||
|
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: postgres:15-alpine
|
image: docker.io/postgres:15-alpine
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ['CMD', 'pg_isready', '-U', 'postgres']
|
test: ['CMD', 'pg_isready', '-U', 'postgres']
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -49,6 +49,10 @@ services:
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
|
|
||||||
|
stator:
|
||||||
|
<<: *takahe-common
|
||||||
|
command: ["/takahe/manage.py", "runstator"]
|
||||||
|
|
||||||
setup:
|
setup:
|
||||||
<<: *takahe-common
|
<<: *takahe-common
|
||||||
command: ["/takahe/manage.py", "migrate"]
|
command: ["/takahe/manage.py", "migrate"]
|
||||||
|
|
|
@ -30,6 +30,42 @@ and local posting/follow functionality; to test ActivityPub itself and follow
|
||||||
other people, your installation **must be accessible from the internet**;
|
other people, your installation **must be accessible from the internet**;
|
||||||
doing that securely is different enough per person that it is not covered here.
|
doing that securely is different enough per person that it is not covered here.
|
||||||
|
|
||||||
|
Using Docker Compose is the fastest way to get up and running, and you will
|
||||||
|
still be able to make web changes and have them appear in real-time. Direct
|
||||||
|
installation is recommended for more advanced developers or those wishing to
|
||||||
|
use a PostgreSQL they already have.
|
||||||
|
|
||||||
|
These instructions are not suitable for running a production copy; for that,
|
||||||
|
see :doc:`installation`.
|
||||||
|
|
||||||
|
Docker
|
||||||
|
~~~~~~
|
||||||
|
|
||||||
|
The docker build process will take care of much of the above, but you just have
|
||||||
|
to be sure that you're executing it from the project root.
|
||||||
|
|
||||||
|
First, you need to build your image::
|
||||||
|
|
||||||
|
docker compose -f docker/docker-compose.yml build
|
||||||
|
|
||||||
|
Then start the ``compose`` session::
|
||||||
|
|
||||||
|
docker compose -f docker/docker-compose.yml up
|
||||||
|
|
||||||
|
At this point, you should be able to see the Web UI at http://localhost:8000
|
||||||
|
|
||||||
|
Once your session is up and running, you can make yourself a superuser account::
|
||||||
|
|
||||||
|
docker compose -f docker/docker-compose.yml exec web manage.py createsuperuser
|
||||||
|
|
||||||
|
And you can run the tests inside your container::
|
||||||
|
|
||||||
|
docker compose -f docker/docker-compose.yml exec web pytest
|
||||||
|
|
||||||
|
If you want to change the settings that Takahē is using, you can edit them
|
||||||
|
near the top of the docker-compose file; the default set are designed for a
|
||||||
|
local installation, though.
|
||||||
|
|
||||||
|
|
||||||
Direct installation
|
Direct installation
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
@ -48,7 +84,7 @@ Then install the development requirements::
|
||||||
|
|
||||||
pip install -r requirements-dev.txt
|
pip install -r requirements-dev.txt
|
||||||
|
|
||||||
and enable the git commit hooks to do auto-formatting and linting
|
Enable the git commit hooks to do auto-formatting and linting
|
||||||
(if you don't do this, our CI system will reject your PRs until they match)::
|
(if you don't do this, our CI system will reject your PRs until they match)::
|
||||||
|
|
||||||
pre-commit install
|
pre-commit install
|
||||||
|
@ -73,30 +109,7 @@ And you can run the tests with pytest::
|
||||||
|
|
||||||
pytest
|
pytest
|
||||||
|
|
||||||
|
If you want to edit settings, you can edit the ``.env`` file.
|
||||||
Docker
|
|
||||||
~~~~~~
|
|
||||||
|
|
||||||
The docker build process will take care of much of the above, but you just have
|
|
||||||
to be sure that you're executing it from the project root.
|
|
||||||
|
|
||||||
First, you need to build your image::
|
|
||||||
|
|
||||||
docker compose -f docker/docker-compose.yml build
|
|
||||||
|
|
||||||
Then start the `compose` session::
|
|
||||||
|
|
||||||
docker compose -f docker/docker-compose.yml up
|
|
||||||
|
|
||||||
At this point, you will be able to see the Web UI at http://localhost:8000
|
|
||||||
|
|
||||||
Once your session is up and running, you can make yourself a superuser account::
|
|
||||||
|
|
||||||
docker compose -f docker/docker-compose.yml exec web manage.py createsuperuser
|
|
||||||
|
|
||||||
And you can run the tests inside your container::
|
|
||||||
|
|
||||||
docker compose -f docker/docker-compose.yml exec web pytest
|
|
||||||
|
|
||||||
|
|
||||||
Coding Guidelines
|
Coding Guidelines
|
||||||
|
|
Loading…
Reference in a new issue