From 639cba9095ba844177b096436a05a79e8047d0a8 Mon Sep 17 00:00:00 2001 From: Confidence Okoghenun Date: Wed, 19 May 2021 06:59:08 -0700 Subject: [PATCH] Improve server setup experience documentation (#4441) * fix: Updates appsmith server docker-compose * fix: Updates server docker-compose * fix: Removes exposed ports * docs: Adds updates for server docker-compose * docs: Adds updates for server docker-compose * docs: Updates app/server/README.md Co-authored-by: Arpit Mohan * chore: Removes deprecated env vars Co-authored-by: Arpit Mohan --- app/server/.gitignore | 1 + app/server/README.md | 38 +++++++++++++++++++++++++++--- app/server/docker-compose.yml | 15 ++++-------- app/server/envs/docker.env.example | 32 ++++++++++++------------- contributions/ServerSetup.md | 2 ++ 5 files changed, 58 insertions(+), 30 deletions(-) diff --git a/app/server/.gitignore b/app/server/.gitignore index 6d1ed7069a..efc8776c80 100644 --- a/app/server/.gitignore +++ b/app/server/.gitignore @@ -11,5 +11,6 @@ node_modules **/.classpath **/.project **/.factorypath +container-volumes *.env dependency-reduced-pom.xml diff --git a/app/server/README.md b/app/server/README.md index 2721304ccc..135bed1833 100644 --- a/app/server/README.md +++ b/app/server/README.md @@ -1,7 +1,39 @@ # Appsmith Server This is the server-side repository for the Appsmith framework. -For details on setting up your development machine, please refer to the [Setup Guide](https://github.com/appsmithorg/appsmith/blob/release/contributions/ServerSetup.md) +For details on setting up your development machine, please refer to the [Setup Guide](../../contributions/ServerSetup.md). Alternatively, you can run the server using docker(see the instructions below). -## Dev Setup -For details on setting up the server on your development machine, please refer to the [Setup Guide](https://github.com/appsmithorg/appsmith/blob/master/contributions/ServerSetup.md) +## Run locally with Docker + +You can run the server codebase in a docker container. This is the easiest way to get the server up and running if all you care about is contributing to the client codebase. + +### What's in the box + +* Appsmith server +* MongoDB +* Redis + +### Pre-requisites + +* [Docker](https://docs.docker.com/get-docker/) + +### Steps for setup + +1. Clone the Appsmith repository and `cd` into it +```sh +git clone https://github.com/appsmithorg/appsmith.git +cd appsmith +``` +2. Change your directory to `app/server` +```sh +cd app/server +``` +3. Create a copy of the `envs/docker.env.example` +```sh +cp envs/docker.env.example envs/docker.env +``` +4. Start up the containers +```sh +docker-compose up -d +``` +5. Have fun! diff --git a/app/server/docker-compose.yml b/app/server/docker-compose.yml index ad99d51deb..e6a1e938ee 100644 --- a/app/server/docker-compose.yml +++ b/app/server/docker-compose.yml @@ -2,35 +2,30 @@ version: "3.7" services: appsmith-internal-server: - image: arpitappsmith/appsmith-server:maven + image: appsmith/appsmith-server env_file: envs/docker.env environment: - APPSMITH_MONGODB_URI: "mongodb://mongo:27017/mobtools" APPSMITH_REDIS_URL: "redis://redis:6379" + APPSMITH_MONGODB_URI: "mongodb://mongo:27017/appsmith" ports: - "8080:8080" - links: - - mongo depends_on: - mongo + - redis networks: - appsmith mongo: image: mongo - ports: - - "27017:27017" environment: - - MONGO_INITDB_DATABASE=mobtools + - MONGO_INITDB_DATABASE=appsmith volumes: - - ./mongo-seed/:/docker-entrypoint-initdb.d/ + - ./container-volumes/mongo:/data/db networks: - appsmith redis: image: redis - ports: - - "6379:6379" networks: - appsmith diff --git a/app/server/envs/docker.env.example b/app/server/envs/docker.env.example index 183ed9ff04..a0daf519f5 100644 --- a/app/server/envs/docker.env.example +++ b/app/server/envs/docker.env.example @@ -1,25 +1,23 @@ #!/bin/sh -APPSMITH_OAUTH2_GOOGLE_CLIENT_ID="" -APPSMITH_OAUTH2_GOOGLE_CLIENT_SECRET="" -APPSMITH_OAUTH2_GITHUB_CLIENT_ID="" -APPSMITH_OAUTH2_GITHUB_CLIENT_SECRET="" +# APPSMITH_OAUTH2_GOOGLE_CLIENT_ID="" +# APPSMITH_OAUTH2_GOOGLE_CLIENT_SECRET="" +# APPSMITH_OAUTH2_GITHUB_CLIENT_ID="" +# APPSMITH_OAUTH2_GITHUB_CLIENT_SECRET="" -APPSMITH_RAPID_API_KEY_VALUE="" +# APPSMITH_MAIL_ENABLED=true +# APPSMITH_MAIL_HOST=localhost +# APPSMITH_MAIL_PORT=25 +# APPSMITH_MAIL_USERNAME= +# APPSMITH_MAIL_PASSWORD= +# APPSMITH_MAIL_SMTP_AUTH=true +# APPSMITH_MAIL_SMTP_TLS_ENABLED=true -APPSMITH_MAIL_ENABLED=true -APPSMITH_MAIL_HOST=localhost -APPSMITH_MAIL_PORT=25 -APPSMITH_MAIL_USERNAME= -APPSMITH_MAIL_PASSWORD= -APPSMITH_MAIL_SMTP_AUTH=true -APPSMITH_MAIL_SMTP_TLS_ENABLED=true +# APPSMITH_MARKETPLACE_USERNAME="" +# APPSMITH_MARKETPLACE_PASSWORD="" -APPSMITH_MARKETPLACE_USERNAME="" -APPSMITH_MARKETPLACE_PASSWORD="" - -APPSMITH_ENCRYPTION_PASSWORD="" -APPSMITH_ENCRYPTION_SALT="" +APPSMITH_ENCRYPTION_PASSWORD="abcd" +APPSMITH_ENCRYPTION_SALT="abcd" #APPSMITH_RECAPTCHA_SITE_KEY="" #APPSMITH_RECAPTCHA_SECRET_KEY="" diff --git a/contributions/ServerSetup.md b/contributions/ServerSetup.md index 5cbc4d2cff..16cfb1eaa7 100644 --- a/contributions/ServerSetup.md +++ b/contributions/ServerSetup.md @@ -2,6 +2,8 @@ The server codebase is written in Java and is powered by Spring + WebFlux. This document explains how you can setup a development environment to make changes and test your changes. +>For details on setting up with `Docker`, please refer to the [Setup Guide](../app/server/README.md#run-locally-with-docker) + ## Pre-requisites - Java --- OpenJDK 11.