-
Notifications
You must be signed in to change notification settings - Fork 13
Update Dev-Setup Documentation & Add docker folder #1241
base: master
Are you sure you want to change the base?
Changes from all commits
8965d7a
ed8ff21
719bddb
d4d61ae
60c8859
dcecd8e
097896e
811a864
90eb7ec
6d25b34
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
NODE_VERSION="19.4" | ||
|
||
BIND_ADDRESS_HOST=localhost | ||
BIND_ADDRESS_PORT=8080 | ||
|
||
# Env variables must have the prefix VITE_ for Vite to include them. | ||
# More information about env variables with Vite can be found here: https://vitejs.dev/guide/env-and-mode.html | ||
VITE_BASE_API_URL=http://localhost:8080 | ||
VITE_NEXTCLOUD_URI=https://cloud.permaplant.net | ||
# OAuth2 (other URLs will be fetched from this URL) | ||
AUTH_DISCOVERY_URI=https://auth.permaplant.net/realms/PermaplanT/.well-known/openid-configuration | ||
AUTH_CLIENT_ID=localhost | ||
|
||
# DB | ||
POSTGRES_USER=permaplant | ||
POSTGRES_DB=permaplant | ||
POSTGRES_PASSWORD=permaplant | ||
PGPASSWORD=permaplant | ||
DATABASE_URL=postgres://permaplant:permaplant@localhost/permaplant | ||
|
||
[email protected] | ||
PGADMIN_DEFAULT_PASSWORD=permaplant |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
POSTGRES_USER=permaplant | ||
POSTGRES_DB=permaplant | ||
POSTGRES_PASSWORD=permaplant | ||
PGPASSWORD=permaplant | ||
DATABASE_URL=postgres://permaplant:permaplant@localhost/permaplant | ||
|
||
[email protected] | ||
PGADMIN_DEFAULT_PASSWORD=permaplant |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# This Dockerfile is used inside the docker-compose.yml as development environment | ||
FROM dpage/pgadmin4:7.3 | ||
|
||
COPY ./servers.json ./servers.json | ||
COPY ./pgpass ../pgpass |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
version: "3.8" | ||
|
||
services: | ||
db: | ||
image: postgis/postgis:13-3.1 | ||
restart: unless-stopped | ||
volumes: | ||
- postgis-data-dev:/var/lib/postgresql/data | ||
env_file: | ||
- .env | ||
ports: | ||
- "5432:5432" | ||
|
||
pgadmin: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.pg | ||
restart: unless-stopped | ||
volumes: | ||
- pgadmin-data-dev:/var/lib/pgadmin | ||
env_file: | ||
- .env.db | ||
ports: | ||
- "5050:80" | ||
|
||
volumes: | ||
pgadmin-data-dev: | ||
external: false | ||
postgis-data-dev: | ||
external: false |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
db:5432:permaplant:permaplant:permaplant |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"Servers": { | ||
"1": { | ||
"Name": "permaplant", | ||
"Group": "Servers", | ||
"Host": "db", | ||
"Port": 5432, | ||
"MaintenanceDB": "postgres", | ||
"Username": "permaplant", | ||
"PassFile": "/pgpass", | ||
"SSLMode": "prefer" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Docker + local | ||
|
||
Run the database in Docker and the frontend and backend locally. | ||
|
||
## Install Docker | ||
|
||
[Install Docker](https://docs.docker.com/engine/install/) for your host OS. | ||
|
||
## Installing Node + Npm | ||
|
||
Make sure node, in the version as required for PermaplanT, is installed, you may use to easily install multiple versions of node [nvm](https://github.com/nvm-sh/nvm), use apt or [download node directly](https://nodejs.org/en/download). | ||
|
||
## Install Rust | ||
|
||
Follow the steps to [install Rust using rustup](https://www.rust-lang.org/tools/install). | ||
|
||
## Run the database | ||
|
||
This runs the Postgis database and PgAdmin. | ||
|
||
```bash | ||
cd docker | ||
docker compose up -d | ||
``` |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,30 @@ | ||||||
# Devcontainer | ||||||
|
||||||
We are also supporting a containerized setup(docker/podman). For more information checkout the README inside [.devcontainer](https://github.com/ElektraInitiative/PermaplanT/blob/master/.devcontainer/README.md). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why can't we use relative links for files in the same repo with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Generally you can but it in many cases (e.g. links to outside of doc/) it won't work on doc.permaplant.net etc. |
||||||
|
||||||
## Background | ||||||
|
||||||
(Devcontainer)[https://code.visualstudio.com/docs/devcontainers/containers] allows you to | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Markdown is the other way round. Please try to write one sentence per line and keep sentences shorter. |
||||||
develop using VSCode, without installing Node and Rust, you only need Docker and the | ||||||
Dockercontainer extention. | ||||||
|
||||||
## Install the extention | ||||||
|
||||||
[Devcontainer](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extention and choose | ||||||
`Dev Containers: Reopen in Container` in the VSCode command palette. The devcontainer includes a `PgAdmin` container on port `5050`, | ||||||
see the `.devcontainer` directory. | ||||||
|
||||||
Within the devcontainer install all dependencies with | ||||||
|
||||||
```bash | ||||||
make install | ||||||
``` | ||||||
|
||||||
## Git user | ||||||
|
||||||
Globally set git credentials are not available in the devcontainer, set them loaclly. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
```bash | ||||||
git config user.name "Your name" | ||||||
git config user.email "Your email" | ||||||
``` |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This description is a bit useless? At least links to running frontend+backend should be provided? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Local | ||
|
||
Run everything locally on your machine. | ||
|
||
## Installing Node + Npm | ||
|
||
Make sure node, in the version as required for PermaplanT, is installed, you may use to easily install multiple versions of node [nvm](https://github.com/nvm-sh/nvm), use apt or [download node directly](https://nodejs.org/en/download). | ||
|
||
## Install Rust | ||
|
||
Follow the steps to [install Rust using rustup](https://www.rust-lang.org/tools/install). | ||
|
||
## Install Postgis | ||
|
||
Install postgres, for instance on Ubuntu: | ||
|
||
```bash | ||
apt-get install libpq-dev postgresql-client | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this install the server? |
||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@horenso simply add/commit suggestion if it is okay.