Commit f7764e84 authored by Robert's avatar Robert
Browse files

Merge branch 'master' into 'master'

Add Docker instructions

See merge request !1
parents 342b77a9 67a06969
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"]
......@@ -2,13 +2,13 @@
Add the required packages:
```
```bash
apt install python3-django python3-djangorestframework
```
Setup the project:
```
```bash
git clone https://lab.allmende.io/balkansalat/commoning-engine.git
cd commoning-engine
python3 manage.py migrate
......@@ -16,8 +16,21 @@ python3 manage.py migrate
Run the development server:
```
```bash
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
Clone project, change working directory, start and create user:
```bash
git clone https://lab.allmende.io/balkansalat/commoning-engine.git
cd commoning-engine/
sudo docker-compose up -d
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