https://floralwebshop.com is one of the largest foral eCommerce website in UAE, hosting thousands of listings of foral for sale.
floralapi is simple web scraper interface to acquire the listing of florals from the website and package it as a JSON api endpoint.
By using Docker, the installation and upgrading to a new version will be easier and will ensure that working code is always shipped. Also, there will be no need for you to setup supervisor or daemon manager for auto starting and restarting the application whenever the server restarts.
YouTube video about Docker and Docker Compose: https://youtu.be/DX1T-PKHKhg
Please note, you don't have to pull the code if you're using Docker.
sudo apt install docker -y
sudo apt install docker-compose -y
Follow this guide to install docker-compose: https://phoenixnap.com/kb/install-docker-compose-ubuntu
Once you have Docker and Docker Compose installed. Run the following command. Create a compose file, docker-compose.yml.
version: '3.3'
services:
web:
image: realworldio/floralapi
restart: always
volumes: ["./data/:/usr/src/app/data"]
environment:
- FLORAL_APP_USERNAME=<username>
- FLORAL_APP_PASSWORD=<password>
ports:
- 8080:8080
Afterwards, run the following command:
docker-compose up -d
You should now be able to access the API endpoint on port 8080.
Using this method, you will need to pull the source code and have both node and npm insalled.
sudo apt install node npm -y
You will need to set the following environment variables:
Make sure you add these in your .bashrc for persistency.
npm install
npm start
Note, you will need to user superviosr or some kind of process manager to auto-run and manage the application in the background as a daemon.
Content type
Image
Digest
Size
574.9 MB
Last updated
about 5 years ago
docker pull realworldio/floralapi