Skip to content

Commit ff03cbc

Browse files
committed
🔧 upgrade dependencies in docker setup; drop outdated Dockerfile
1 parent 6e50f80 commit ff03cbc

File tree

6 files changed

+50
-123
lines changed

6 files changed

+50
-123
lines changed

‎Dockerfile

-29
This file was deleted.

‎README.md

+18-24
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
[FragDenStaat.de](https://fragdenstaat.de) is the German instance of [Froide](https://github.com/okfde/froide) – a freedom of information portal software.
66

7-
87
## Development environment
98

109
FragDenStaat.de is a Django app with a PostgreSQL+PostGIS database and elasticsearch search service.
@@ -17,7 +16,8 @@ If you do not want to use Docker, you can install this like any Django project w
1716
FragDenStaat.de is a Django project that uses the core `froide` project and other `froide` Django apps as plugins. These froide and related apps are installed from repositories and it makes sense to set them up on your dev machine.
1817

1918
You need to have installed:
20-
- Python 3.8+
19+
20+
- Python 3.10+
2121
- yarn
2222
- GDAL for Django's GeoDjango
2323
- freetype and imagemagick
@@ -32,14 +32,14 @@ All of these dependencies should be installable via package managers (e.g. `brew
3232

3333
To make the setup easier the following script (`devsetup.sh`) creates a virtual environment, sets up and installs all repos of the Python backend and installs and links all repos of the JavaScript frontend build.
3434

35-
```
35+
```bash
3636
cd project-dir
3737
curl https://raw.githubusercontent.com/okfde/fragdenstaat_de/main/devsetup.sh | bash
3838
```
3939

4040
To update your setup later:
4141

42-
```
42+
```bash
4343
cd project-dir
4444
bash fragdenstaat_de/devsetup.sh
4545
```
@@ -50,19 +50,19 @@ You can run your own Postgres+PostGIS database and Elasticsearch service or run
5050

5151
You need [Docker Desktop](https://docs.docker.com/desktop). Make sure Docker is running and use the following command:
5252

53-
```
54-
docker compose -f docker-compose.dev.yml up
53+
```bash
54+
docker compose -f compose-dev.yaml up
5555
```
5656

57-
This will start Postgres and Elasticsearch and listen on port 5432 and 9200 respectively. You can adjust the port mapping in the `docker-compose.dev.yml`.
57+
This will start Postgres and Elasticsearch and listen on port 5432 and 9200 respectively. You can adjust the port mapping in the `compose-dev.yaml`.
5858

5959
### Setup database
6060

6161
If you need to adjust settings, you can copy the `fragdenstaat_de/settings/local_settings.py.example` to `fragdenstaat_de/settings/local_settings.py` and edit it.
6262

6363
To initialise the database:
6464

65-
```
65+
```bash
6666
# Activate virtualenv
6767
source fds-env/bin/activate
6868
cd fragdenstaat_de
@@ -72,7 +72,7 @@ python manage.py migrate --skip-checks
7272

7373
To get started with some data:
7474

75-
```
75+
```bash
7676
# Load initial data (e.g. some CMS test fixtures)
7777
python manage.py loaddata tests/fixtures/cms.json
7878
# Create a superuser
@@ -86,40 +86,37 @@ python manage.py search_index --populate
8686

8787
Example of loading SQL dumps into Docker postgres:
8888

89-
```
90-
docker compose -f docker-compose.dev.yml exec db dropdb -U fragdenstaat_de fragdenstaat_de
91-
docker compose -f docker-compose.dev.yml exec db createdb -U fragdenstaat_de -O fragdenstaat_de fragdenstaat_de
92-
gunzip -k -c dump.sql.gz | docker compose -f docker-compose.dev.yml exec -T db psql -U fragdenstaat_de
89+
```bash
90+
docker compose -f compose-dev.yaml exec db dropdb -U fragdenstaat_de fragdenstaat_de
91+
docker compose -f compose-dev.yaml exec db createdb -U fragdenstaat_de -O fragdenstaat_de fragdenstaat_de
92+
gunzip -k -c dump.sql.gz | docker compose -f compose-dev.yaml exec -T db psql -U fragdenstaat_de
9393
```
9494

9595
### Quick start after setup
9696

97-
```
97+
```bash
9898
source fds-env/bin/activate
9999
cd fragdenstaat_de
100100
# Start service in background with -d
101-
docker compose -f docker-compose.dev.yml up -d
101+
docker compose -f compose-dev.yaml up -d
102102
python manage.py runserver
103103
```
104104

105105
### Frontend development
106106

107-
```
107+
```bash
108108
cd fragdenstaat_de
109-
yarn run serve
109+
yarn run dev
110110
```
111111

112112
### Upgrade dependencies
113113

114-
Currently `pip-compile` only works for `pip-tools==6.3.0` and `pip==21.2.4`.
115-
116-
```
114+
```bash
117115
pip-compile -U requirements.in
118116
pip-compile -U requirements-dev.in
119117
pip-compile -U requirements-production.in
120118
```
121119

122-
123120
### Main app dependencies
124121

125122
The `fragdenstaat_de` project depends on `froide`, multiple `froide`-related apps.
@@ -134,9 +131,6 @@ flowchart LR
134131
135132
```
136133

137-
138134
## License
139135

140136
Froide and fragdenstaat_de are licensed under the AGPL License.
141-
142-
Some folders contain an attributions.txt with more information about the copyright holders for files in this specific folder.

‎compose-dev.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
services:
2+
db:
3+
image: postgis/postgis:16-3.4
4+
volumes:
5+
- pg-data:/var/lib/postgresql/
6+
ports:
7+
- '127.0.0.1:5432:5432'
8+
environment:
9+
POSTGRES_USER: fragdenstaat_de
10+
POSTGRES_DB: fragdenstaat_de
11+
POSTGRES_PASSWORD: fragdenstaat_de
12+
13+
elasticsearch:
14+
build: ./deps/elasticsearch/
15+
volumes:
16+
- es-data:/usr/share/elasticsearch/data
17+
- es-logs:/var/log
18+
environment:
19+
- 'discovery.type=single-node'
20+
- 'cluster.routing.allocation.disk.threshold_enabled=false'
21+
- 'cluster.routing.allocation.disk.watermark.low=3gb'
22+
- 'cluster.routing.allocation.disk.watermark.high=2gb'
23+
- 'cluster.routing.allocation.disk.watermark.flood_stage=1gb'
24+
- 'xpack.security.enabled=false'
25+
ports:
26+
- '127.0.0.1:9200:9200'
27+
28+
volumes:
29+
es-data:
30+
es-logs:
31+
pg-data:

‎deps/elasticsearch/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM docker.elastic.co/elasticsearch/elasticsearch:8.11.3
1+
FROM elasticsearch:8.14.3
22

33
RUN mkdir -p /usr/share/elasticsearch/config/analysis && curl -o /usr/share/elasticsearch/config/analysis/de_DR.xml "https://raw.githubusercontent.com/uschindler/german-decompounder/master/de_DR.xml"
44
RUN mkdir -p /usr/share/elasticsearch/config/analysis && curl -o /usr/share/elasticsearch/config/analysis/dictionary-de.txt "https://raw.githubusercontent.com/uschindler/german-decompounder/master/dictionary-de.txt"

‎docker-compose.dev.yml

-32
This file was deleted.

‎docker-compose.yml

-37
This file was deleted.

0 commit comments

Comments
 (0)