Plant-it
Plant-it is a self-hosted gardening companion app.
Useful for keeping track of plant care, receiving notifications about when to water plants, uploading plant images, and more.
Installing Plant-it is pretty straight forward, in order to do so follow these steps:
-
Create a folder
andwhere
youcdintowantit.
to place all Plant-it related files.Create -
thatCreateInsidefrontend.envfolder,
createfrontend.envPORT=3000aAPI_URL=http://hostIPadress:8089/apifileWAIT_TIMEOUT=5000 PAGE_SIZE=25 BROWSER=noneCreatenameddocker-compose.yml
with this content:version: "3"name: plant-it services:backend:server: image: msdeluise/plant-it-backend:server:latest env_file:backend.server.env depends_on: - db - cache restart: unless-stopped volumes: - "./srv/Files/path/Plant-it/upload-dir:/upload-dir" ports: - "8089:8080:8080"#match-with frontend"3000:3000" db: image: mysql:8.0 restart: always env_file:backend.server.env volumes: - "./srv/Files/path/Plant-it/db:/var/lib/mysql" cache: image: redis:7.2.1 restart: alwaysfrontend:image: -
env_file:Inside
frontend.that folder, create a file namedserver.env
withlinks: - backend ports: - "3009:3000" #matchbackendthis content:
backend.env
backend.env
MYSQL_HOST=db
MYSQL_PORT=3306
MYSQL_USERNAME=root
MYSQL_PSW=root
MYSQL_ROOT_PASSWORD=root
MYSQL_DATABASE=bootdb
JWT_SECRET=32characterscomplicatedkey
JWT_EXP=1
USERS_LIMIT=2 # including the admin account, so <= 0 if undefined, >= 2 if defined
UPLOAD_DIR=/upload-dir
API_PORT=8080
CACHE_TTL=86400
CACHE_HOST=cache
CACHE_PORT=6379
TRAFLE_KEY=your key from https://trefle.io/
ALLOWED_ORIGINS=*
#
# DB
#
MYSQL_HOST=db
MYSQL_PORT=3306
MYSQL_USERNAME=root
MYSQL_PSW=root
MYSQL_DATABASE=bootdb
MYSQL_ROOT_PASSWORD=root
#
# JWT
#
JWT_SECRET=putTheSecretHere
JWT_EXP=1
#
# Server config
#
USERS_LIMIT=-1
UPLOAD_DIR=/upload-dir
API_PORT=8080
FLORACODEX_KEY=
LOG_LEVEL=DEBUG
ALLOWED_ORIGINS=*
#
# Cache
#
CACHE_TTL=86400
CACHE_HOST=cache
CACHE_PORT=6379
- Run the docker compose file (
docker compose -f docker-
),composecompose.yml up -dChange port bindingBackendIf you don't want to usethen thedefaultserviceportwill be available at
,8080localhost:3000you can follow these steps:changewhile theportRESTbindingAPIinwillthebe available atdocker-compose.ymllocalhost:8080/apifile, e.g.(9090:8080to setup the port
for the9090localhost:8080/api/swagger-ui/index.htmlbackenddocumentationserviceof them).update
Take a look at the
API_URLdocumentation(frontend.envfile) variablein order topoints tounderstand thecorrectavailablebackend address
Frontend
If you don't want to use the default port 3000, you can follow these steps:configurations.
change the port binding in thedocker-compose.ymlfile, e.g.4040:3000to setup the port4040for the frontend service