openclimatefix / india-forecast-app

Runs wind and PV forecasts for India and saves to database
MIT License
1 stars 4 forks source link

Docker not working #25

Closed peterdudfield closed 6 months ago

peterdudfield commented 6 months ago

Detailed Description

App is working when running with python, but not in docker env

I used docker compse

version: "3"

services:
  forecast:
    build:
      context: .
      dockerfile: Dockerfile
    environment:
      - DB_URL=postgresql://main:password@host.docker.internal:5433/indiadbdevelopment
      - NWP_ZARR_PATH=./nwp.zarr
    expose:
      - 5433
    ports:
      - 5433:5433
    extra_hosts:
      # To get DOCKERHOST use
      # export DOCKERHOST=$(ifconfig | grep -E "([0-9]{1,3}\.){3}[0-9]{1,3}" | grep -v 127.0.0.1 | awk '{ print $2 }' | cut -f2 -d: | head -n1)
      - "dockerhost:${DOCKERHOST}"
    volumes:
      - ./india_forecast_app/:/app/india_forecast_app

Context

trying to get windnet running for the first time

Docker file hangs (but doesnt fail)

Screenshot 2024-02-27 at 18 08 12

Possible Implementation

confusedmatrix commented 6 months ago

After a lot of back and forth today, I finally got it working setting workers=0 in Dataloader. Very difficult to find the issue, but super simple fix.

I've reverted the Dockerfile to multistage build as I was having issues getting the Dockerfile to build on my end. Not sure if this has regressed the size of the Docker image (hopefully not, shows as 1.52GB when building locally on a mac).