#!/bin/bash

# build the flask container
docker build -t studX/foodtrucks-web ./

# create the network
docker network create foodtrucks-network

# start the ES container, specify password beforehand
docker run -d --net foodtrucks-network --name elastic -e ELASTIC_PASSWORD=v7SLsbtXticPLADei5vS elasticsearch:8.4.3

# start the flask app container 
# point to elastic host: https://elastic:9200 user: elastic password: v7SLsbtXticPLADei5vS
docker run -d -p 80:5000 --net foodtrucks-network studX/foodtrucks-web https elastic 9200 elastic v7SLsbtXticPLADei5vS
