diff --git a/.deployment/deploy-deepforge b/.deployment/deploy-deepforge index 568f3568d..f73d309f7 100755 --- a/.deployment/deploy-deepforge +++ b/.deployment/deploy-deepforge @@ -17,7 +17,8 @@ fi; rm config/components2.json # Merging the custom override yml file -yaml-merge docker/docker-compose.yml "$DEEPFORGE_DEPLOYMENT_DIR"/docker-compose-overrides.yml > custom-docker-compose.yml +yq d docker/docker-compose.yml services.server.environment[0] > custom-docker-compose.yml +yq m -ai custom-docker-compose.yml "$DEEPFORGE_DEPLOYMENT_DIR"/docker-compose-overrides.yml # Pulling the latest docker image, stopping the server, removing and restarting it docker-compose --file custom-docker-compose.yml -p deepforge pull $SERVER_NAME diff --git a/.deployment/docker-compose-overrides.yml b/.deployment/docker-compose-overrides.yml index 9f9cab71a..d1c4c9bd3 100644 --- a/.deployment/docker-compose-overrides.yml +++ b/.deployment/docker-compose-overrides.yml @@ -2,10 +2,10 @@ services: server: entrypoint: /.deployment/dev-entrypoint.sh environment: + - "NODE_ENV=production" - "DEEPFORGE_HOST=https://dev.deepforge.org" - "DEEPFORGE_INTERACTIVE_COMPUTE_HOST=https://dev-compute.deepforge.org" volumes: - - "$HOME/.deepforge/blob:/data/blob" - "${TOKEN_KEYS_DIR}:/token_keys" - "${DEEPFORGE_DEPLOYMENT_DIR}:/.deployment" - "${DEEPFORGE_DEPLOYMENT_DIR}/../config/components.json:/deepforge/config/components.json" diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index a9aff9bdc..8bcb44f74 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -7,6 +7,7 @@ services: - "$HOME/.deepforge/data:/data/db" server: environment: + - "NODE_ENV=default" - "MONGO_URI=mongodb://mongo:27017/deepforge" - "DEEPFORGE_PUBLIC_KEY=/token_keys/public_key" - "DEEPFORGE_PRIVATE_KEY=/token_keys/private_key" @@ -16,6 +17,5 @@ services: - "8889:8889" volumes: - "$HOME/.deepforge/blob:/data/blob" - - "${TOKEN_KEYS_DIR}:/token_keys" depends_on: - mongo diff --git a/docs/deployment/quick_start.rst b/docs/deployment/quick_start.rst index ac5bd23e8..e69afcb43 100644 --- a/docs/deployment/quick_start.rst +++ b/docs/deployment/quick_start.rst @@ -12,19 +12,7 @@ Next, you must decide if you would like authentication to be enabled. For produc Without User Accounts --------------------- -Open the docker-compose file and add the following environment variable to the server: - -.. code-block:: bash - - NODE_ENV=default - -and delete the volume for the server's keys (used for signing JWTs): - -.. code-block:: bash - - - "${TOKEN_KEYS_DIR}:/token_keys" - -Next, start the docker containers with +Start the docker containers with .. code-block:: bash @@ -41,11 +29,36 @@ First, generate a public and private key pair openssl rsa -in deepforge_keys/private_key -pubout > deepforge_keys/public_key export TOKEN_KEYS_DIR="$(pwd)/deepforge_keys" +Then create file called ``production-docker-compose.yml`` for using the token-keys generated above: + +.. code-block:: yaml + + version: "3" + services: + mongo: + image: mongo + volumes: + - "$HOME/.deepforge/data:/data/db" + server: + environment: + - "MONGO_URI=mongodb://mongo:27017/deepforge" + - "DEEPFORGE_PUBLIC_KEY=/token_keys/public_key" + - "DEEPFORGE_PRIVATE_KEY=/token_keys/private_key" + image: deepforge/kitchen-sink:latest + ports: + - "8888:8888" + - "8889:8889" + volumes: + - "$HOME/.deepforge/blob:/data/blob" + - "${TOKEN_KEYS_DIR}:/token_keys" + depends_on: + - mongo + Then start DeepForge using docker-compose: .. code-block:: bash - docker-compose up + docker-compose --file production-docker-compose.yml up Finally, create the admin user by connecting to the server's docker container. First, get the ID of the container using: