Commit 859525be authored by Florian's avatar Florian
Browse files

Add Docker instructions

parent 342b77a9
FROM python:3.10-rc-alpine
WORKDIR /app
RUN apk add git # patch
RUN pip install Django==3.1.2 djangorestframework==3.12.1
RUN git clone https://lab.allmende.io/balkansalat/commoning-engine.git
COPY ./settings.patch .
# RUN patch --forward --reject-file=- --no-backup-if-mismatch ./commoning-engine/engine/settings.py ./settings.patch
RUN python ./commoning-engine/manage.py migrate
EXPOSE 8000
CMD ["python", "./commoning-engine/manage.py", "runserver", "0.0.0.0:8000"]
......@@ -20,4 +20,12 @@ Run the development server:
python3 manage.py runserver
```
Now you may visit [localhost:8000/api/v1/](localhost:8000/api/v1/) for access to the REST API and [localhost:8000/admin/](localhost:8000/admin/) for the admin backend. You may create an admin user by running `python3 manage.py createsuperuser`.
\ No newline at end of file
Now you may visit [localhost:8000/api/v1/](localhost:8000/api/v1/) for access to the REST API and [localhost:8000/admin/](localhost:8000/admin/) for the admin backend. You may create an admin user by running `python3 manage.py createsuperuser`.
# Run with Docker
- start with `sudo docker-compose up -d`
- create user with `sudo docker exec -ti app python /app/commoning-engine/manage.py createsuperuser`
- if you encounter a Django error regarding the `ALLOWED_HOSTS` setting, uncomment the lines in the `Dockerfile` and build again with `sudo docker-compose up -d --build`
version: "2.0"
services:
app:
build: .
container_name: commoning-engine
ports:
- "8000:8000"
28c28
< ALLOWED_HOSTS = []
---
> ALLOWED_HOSTS = ['*']
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment