-
Notifications
You must be signed in to change notification settings - Fork 12
Update Dev-Setup Documentation & Add docker folder #1241
base: master
Are you sure you want to change the base?
Changes from 8 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,25 @@ | ||||||||
| # 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 20 + Npm | ||||||||
|
|
||||||||
| Make sure node 20 is installed, you may use to easly install multiple versions of node [nvm](https://github.com/nvm-sh/nvm), | ||||||||
|
||||||||
| Make sure node 20 is installed, you may use to easly install multiple versions of node [nvm](https://github.com/nvm-sh/nvm), | |
| 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), |
Outdated
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.
| Make sure node 20 is installed, you may use to easly install multiple versions of node [nvm](https://github.com/nvm-sh/nvm), | |
| use apt or [download node directly](https://nodejs.org/en/download). | |
| Make sure node 20 is installed, you may use [nvm](https://github.com/nvm-sh/nvm) to easily install multiple versions of node, use apt or [download node directly](https://nodejs.org/en/download). |
horenso marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
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.
| cd docker | |
| cd .docker |
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.
| 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). | ||||||
|
Contributor
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
Contributor
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
Contributor
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 | ||||||
|
Contributor
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. | ||||||
|
Contributor
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" | ||||||
| ``` | ||||||
|
Contributor
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,20 @@ | ||||||
| # Local | ||||||
|
|
||||||
| Run everything locally on your machine. | ||||||
|
|
||||||
| ## Installing Node 20 + Npm | ||||||
|
|
||||||
| Make sure node 20 is installed, you may use to easly 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 sets to [install Rust using rustup](https://www.rust-lang.org/tools/install). | ||||||
|
||||||
| Follow the sets to [install Rust using rustup](https://www.rust-lang.org/tools/install). | |
| Follow the steps to [install Rust using rustup](https://www.rust-lang.org/tools/install). |
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.
Does this install the server?
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3,22 +3,36 @@ | |||||
| ## Prerequisites | ||||||
|
|
||||||
| If you want to develop on the backend, make sure you have enough RAM. | ||||||
| When performing cargo build, we have experienced (on wsl) a usage of ~12GB. | ||||||
|
|
||||||
| - Python | ||||||
| - Rust | ||||||
| - Javascript | ||||||
| - nvm | ||||||
| - node | ||||||
| When performing cargo build, we have experienced a usage of ~12GB. | ||||||
|
|
||||||
| ## Operating Systems | ||||||
|
|
||||||
| - Windows 11 | ||||||
| - macOS 13.1 (Unix) | ||||||
| - Ubuntu or another Ubuntu/Debian-based Linux system | ||||||
| - Ubuntu in [WSL](https://learn.microsoft.com/de-de/windows/wsl/install) on Windows | ||||||
|
|
||||||
| ## Ways to develop PermaplanT | ||||||
|
|
||||||
| Right now we have three different ways to develop Permaplant: | ||||||
|
||||||
| Right now we have three different ways to develop Permaplant: | |
| Right now we have three different ways to develop PermaplanT: |
|
Contributor
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. rename folder to .docker |
| 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 |
|
Contributor
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. Is it really necessary to more or less duplicate everything from
Contributor
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. we can also compose it from different compose files for .devcontainer and this setup, it's slightly different for instance it uses the host network |
| 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" | ||
| } | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.