2022-07-03 13:47:38 +02:00
# Deploying Marketplace
### Prerequisites
2022-07-25 22:58:06 +02:00
* A server for hosting Ocean Marketplace. See [this guide ](setup-server.md ) on creating a server.
2023-06-19 17:05:08 +02:00
* Obtain API key for wanted network. See [this guide ](https://app.gitbook.com/o/mTcjMqA4ylf55anucjH8/s/BTXXhmDGzR0Xgj13fyfM/\~/changes/548/developers/obtaining-api-keys-for-blockchain-access ) for this.
2022-07-03 13:47:38 +02:00
2023-06-13 11:08:38 +02:00
### Push your customized Ocean Market code to your Git repository
In case you customized the Ocean Market using the tutorial from this chapter (link), push your code to a Git repository.
### Create a directory
2022-07-03 13:47:38 +02:00
2023-06-27 12:22:33 +02:00
```bash
2022-07-03 13:47:38 +02:00
mkdir my-marketplace
cd my-marketplace
```
2023-06-13 11:08:38 +02:00
### Create a file with the name \`.env\`
2022-07-03 13:47:38 +02:00
2023-06-13 11:08:38 +02:00
If you already created the .env file as instructed in ...(link to customize the market chapter), you can skip this step, otherwise copy the below content into the \`.env\` file.
2022-07-03 13:47:38 +02:00
2023-06-19 16:59:13 +02:00
{% code title=".env" overflow="wrap" %}
2023-06-27 12:22:33 +02:00
```bash
2023-06-13 11:08:38 +02:00
# Update this value if your Market should use custom Aquarius
2022-07-11 16:08:46 +02:00
NEXT_PUBLIC_METADATACACHE_URI=https://v4.aquarius.oceanprotocol.com
2023-06-19 16:59:13 +02:00
# Provide INFURA project ID from the obtained API key for NEXT_PUBLIC_INFURA_PROJECT_ID
#NEXT_PUBLIC_INFURA_PROJECT_ID="xxx"
2022-07-11 16:08:46 +02:00
#NEXT_PUBLIC_MARKET_FEE_ADDRESS="0xxx"
#NEXT_PUBLIC_PUBLISHER_MARKET_ORDER_FEE="1"
#NEXT_PUBLIC_CONSUME_MARKET_ORDER_FEE="1"
#NEXT_PUBLIC_CONSUME_MARKET_FIXED_SWAP_FEE="1"
#
# ADVANCED SETTINGS
#
# Toggle pricing options presented during price creation
#NEXT_PUBLIC_ALLOW_FIXED_PRICING="true"
#NEXT_PUBLIC_ALLOW_FREE_PRICING="true"
# Privacy Preference Center
#NEXT_PUBLIC_PRIVACY_PREFERENCE_CENTER="true"
2022-07-03 13:47:38 +02:00
```
{% endcode %}
2023-06-13 11:08:38 +02:00
### Create a \`Dockerfile\` file and copy the below content into it.
2022-07-03 13:47:38 +02:00
2023-10-11 21:22:40 +02:00
In the following Dockerfile, replace \<YOUR\_GIT\_REPO\_URL> with the url of your Ocean Market fork repository or use "https://github.com/oceanprotocol/market.git" if you want to deploy the standard image of Ocean Market.
2023-06-13 11:08:38 +02:00
< pre class = "language-docker" data-title = "Dockerfile" > < code class = "lang-docker" > FROM node:16
< strong > RUN git clone < YOUR_GIT_REPO_URL> /usr/app/market
< / strong > WORKDIR /usr/app/market
2022-07-03 13:47:38 +02:00
RUN npm ci --legacy-peer-deps
RUN npm run build
EXPOSE 3000
CMD ["npx", "next", "start"]
2023-06-13 11:08:38 +02:00
< / code > < / pre >
2022-07-03 13:47:38 +02:00
2023-06-13 11:08:38 +02:00
### Build a docker image
2022-07-03 13:47:38 +02:00
2022-07-05 12:41:58 +02:00
```bash
docker build . -f Dockerfile -t market:latest
2022-07-03 13:47:38 +02:00
```
### Start the marketplace
2023-06-13 11:08:38 +02:00
```bash
docker start market
```