Skip to content

Commit

Permalink
Merge pull request #56 from mollie/feature/MOL-357/PICT-241
Browse files Browse the repository at this point in the history
MOL-357/PICT-241: update docs folder
  • Loading branch information
Tung-Huynh-Shopmacher authored Sep 11, 2024
2 parents 1226533 + 78675a7 commit 359aa96
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions docs/SelfHostingDockerImage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Self-hosting with AWS

This guide provides instructions for self-hosting the Mollie commercetools connector on AWS.

To get started, you need to have a Docker image for the connector.

## Docker Image

This Dockerfile is designed to create a Docker image for a Node.js application using a multi-stage build process. It separates the build environment from the runtime environment to optimize the final image size.

**File path:** [Dockerfile](https://github.com/mollie/commercetools-connector/blob/main/processor/Dockerfile)

### Prerequisites

- Docker installed on your machine.
- Basic knowledge of Docker commands.

### Building the Docker Image

To build the Docker image, navigate to the directory containing the Dockerfile and run the following command:

```bash
docker build -t your-image-name .
```

Replace `your-image-name` with a name of your choice for the Docker image.

### Running the Docker Container

After building the image, you can run the container using the following command:

```bash
docker run -p 8080:8080 your-image-name
```

This command maps port 8080 of the container to port 8080 on your host machine.

### Accessing the Application

Once the container is running, you can access the application by navigating to `http://localhost:8080` in your web browser.

### Stopping the Container

To stop the running container, you can use the following commands:

```bash
docker ps # Find the container ID
docker stop <container_id>
```

Replace `<container_id>` with the actual ID of the running container.

### Notes

- Ensure that your application is configured to listen on the correct port (8080).
- The image is built with production dependencies only, ensuring a smaller footprint.

## Setup Scripts

By using the API setup endpoint below, the connector URL will be the original URL of Express to install necessary configurations and extensions on commercetools.

### Install Connector Configurations

**Endpoint:** `POST {connectorUrl}/processor/install`
**Response:**

- On success: Returns a success message with a status code of 200.
- On failure: Returns an error message with a status code of 400 or other relevant error codes.

### Uninstall Connector Configurations

**Endpoint:** `POST {connectorUrl}/processor/uninstall`
**Response:**

- On success: Returns a success message with a status code of 200.
- On failure: Returns an error message with relevant error codes.

0 comments on commit 359aa96

Please sign in to comment.