metasfresh / metasfresh-docker

GNU General Public License v2.0
37 stars 40 forks source link

WEBAPI_URL not working on MacOS #29

Closed pablosichert closed 7 years ago

pablosichert commented 7 years ago

I'm trying to run the metasfresh stack using

docker-compose up -d

When I comment out

#- WEBAPI_URL=http://example.com:8080

I can access http://localhost, but the site is blank and returns an error:

Uncaught (in promise) TypeError: Cannot read property 'status' of undefined
    at App.<anonymous> (App.js:61)
    at <anonymous>

I assume that's the case since http://localhost/config.js contains placeholder information:

const config = {
        API_URL: 'http://MYDOCKERHOST:PORT/rest/api',
        WS_URL: 'http://MYDOCKERHOST:PORT/stomp'
}

Trying the following configs didn't work for me either:


- WEBAPI_URL=http://localhost:8080
ERROR: for webui  Cannot create container for service webui: invalid bind mount spec "WEBAPI_URL=http://localhost:8080": invalid mode: 8080

- WEBAPI_URL=http://localhost
ERROR: for webui  Cannot create container for service webui: create WEBAPI_URL=http: "WEBAPI_URL=http" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path

This might be an issue with running docker on MacOS, since I got it working on Linux.

pablosichert commented 7 years ago

Oh, I mistook the comment for a multiline annotation and did

#uncomment and set to URL where metasfresh will be available from browsers
#environment:
  - WEBAPI_URL=http://localhost

instead of

#uncomment and set to URL where metasfresh will be available from browsers
environment:
  - WEBAPI_URL=http://localhost

(notice #environment).

ibe-martin commented 4 years ago

Hello. I have the same issue and I don't get it to work on Mac OS 10.15.6. No matter what I am trying I always get the error message:

ERROR: In file './docker-compose.yml', services 'environment' must be a mapping not an array.

Here is my file:

db:
  build: db
  restart: always
  volumes:
    - ./volumes/db/data:/var/lib/postgresql/data
    - ./volumes/db/log:/var/log/postgresql
    - /etc/localtime:/etc/localtime:ro
    - /etc/timezone:/etc/timezone:ro
  environment:
    - METASFRESH_USERNAME=metasfresh
    - METASFRESH_PASSWORD=metasfresh
    - METASFRESH_DBNAME=metasfresh
    - DB_SYSPASS=System
    - POSTGRES_PASSWORD=ip2LmNzXX8p8iXg9lZTWEJ9524kQDbXFudB7LR03T-xK9fLweX3TLMkA2AYcEiaS
app:
  build: app
  hostname: app
  links:
    - db:db
    - rabbitmq:rabbitmq
    - search:search
  expose:
    - "8282"
    - "61616"
    - "8788"
  restart: always
  volumes:
    - ./volumes/app/log:/opt/metasfresh/log:rw
    - ./volumes/app/heapdump:/opt/metasfresh/heapdump:rw
    - /etc/localtime:/etc/localtime:ro
    - /etc/timezone:/etc/timezone:ro
  environment:
    - METASFRESH_HOME=/opt/metasfresh
webapi:
  build: webapi
  links:
    - app:app
    - db:db
    - rabbitmq:rabbitmq
    - search:search
  expose:
    - "8789"
# to access the webui-api directly 
# (eg. for debugging or connecting your app to the metasfresh api) 
# uncomment following port:
  #ports:
   #- "8080:8080"
  restart: always
  volumes:
    - ./volumes/webapi/log:/opt/metasfresh-webui-api/log:rw
    - ./volumes/webapi/heapdump:/opt/metasfresh-webui-api/heapdump:rw
    - /etc/localtime:/etc/localtime:ro
    - /etc/timezone:/etc/timezone:ro
webui:
  build: webui
  links:
    - webapi:webapi
  ports:
    - "80:80"
    - "443:443"
  restart: always
  volumes:
    - /etc/localtime:/etc/localtime:ro
    - /etc/timezone:/etc/timezone:ro
  #uncomment and set to URL where metasfresh will be available from browsers
environment:
    - WEBAPI_URL="http://localhost:8080"
rabbitmq:
  build: rabbitmq
  expose:
    - "5672"
  restart: always
  volumes:
    - ./volumes/rabbitmq/log:/var/log/rabbitmq/log
    - /etc/localtime:/etc/localtime:ro
    - /etc/timezone:/etc/timezone:ro
  environment:
    RABBITMQ_DEFAULT_USER: "metasfresh"
    RABBITMQ_DEFAULT_PASS: "metasfresh"
    RABBITMQ_DEFAULT_VHOST: "/"
search:
  build: search
  ulimits:
    memlock:
      soft: -1
      hard: -1
    nofile:
      soft: 65536
      hard: 65536
  cap_add:
    - IPC_LOCK
# to access the search api directly
# (e.g. if you did docker-compose up search to have the deachboard with your locally running metasfresh services)
# uncomment following ports:
# ports:
#   - "9200:9200"
#   - "9300:9300"
  volumes:
    - ./volumes/search/data:/usr/share/elasticsearch/data
    - /etc/localtime:/etc/localtime:ro
    - /etc/timezone:/etc/timezone:ro
  environment:
    - "ES_JAVA_OPTS=-Xms128M -Xmx256m"
  restart: always

Can anybody tell me what's wrong?

Many thanks!

ibe-martin commented 4 years ago

I change this lines and it worked:

  environment:
    - WEBAPI_URL=http://localhost:8080