Apache Superset Configuration in local machine not loading properly - docker

Tried configuring the Superset in local machine, but it ends up with broken links and images as attached below..enter image description here
Tried increasing the RAM size in docker preferences and also tried removing all the existing containers and volume and rebuild it, but the issue still remains the same.
Here by attached the terminal message,
A Default SECRET_KEY was detected, please use superset_config.py to override it.
superset_init | Use a strong complex alphanumeric string and use a tool to help you generate
superset_init | a sufficiently random sequence, ex: openssl rand -base64 42
superset_init | --------------------------------------------------------------------------------
superset_init | --------------------------------------------------------------------------------
superset_init | 2022-08-25 06:18:59,927:INFO:superset.utils.logging_configurator:logging was configured successfully
superset_init | 2022-08-25 06:18:59,954:INFO:root:Configured event logger of type
superset_worker_beat | [2022-08-25 06:19:00,014: INFO/MainProcess] Scheduler: Sending due task reports.scheduler (reports.scheduler)
superset_worker | [2022-08-25 06:19:00,041: INFO/MainProcess] Task reports.scheduler[9e6d7309-2a70-4ca7-82be-e5c96e8aa206] received
superset_node | npm WARN config optional Use `--omit=optional` to exclude optional dependencies, or
superset_node | npm WARN config `--include=optional` to include them.
superset_node | npm WARN config
superset_node | npm WARN config Default value does install optional deps unless otherwise omitted.
superset_node | npm WARN using --force Recommended protections disabled.
superset_worker | [2022-08-25 06:19:00,184: INFO/ForkPoolWorker-1] Task reports.scheduler[9e6d7309-2a70-4ca7-82be-e5c96e8aa206] succeeded in 0.13767425700007152s: None
superset_init | /usr/local/lib/python3.8/site-packages/flask_appbuilder/models/sqla/interface.py:68: SAWarning: relationship 'SqlaTable.slices' will copy column tables.id to column slices.datasource_id, which conflicts with relationship(s): 'Slice.table' (copies tables.id to slices.datasource_id). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards. To silence this warning, add the parameter 'overlaps="table"' to the 'SqlaTable.slices' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)
superset_init | for prop in class_mapper(obj).iterate_properties:
superset_init | 2022-08-25 06:19:09,924:INFO:superset.utils.database:Creating database reference for examples
superset_init | 2022-08-25 06:19:11,021:DEBUG:superset.models.core:Database.get_sqla_engine(). Masked URL: postgresql://superset:XXXXXXXXXX#db:5432/superset
superset_app | 127.0.0.1 - - [25/Aug/2022 06:19:24] "GET /health HTTP/1.1" 200 -
superset_app | 2022-08-25 06:19:24,675:INFO:werkzeug:127.0.0.1 - - [25/Aug/2022 06:19:24] "GET /health HTTP/1.1" 200 -
Commands tried :
docker compose down -v
docker compose up
But it works well with the non-dev environment with the following command:
docker-compose -f docker-compose-non-dev.yml pull
docker-compose -f docker-compose-non-dev.yml up
Hereby attached the docker-compose.yml file
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
x-superset-image: &superset-image apache/superset:${TAG:-latest-dev}
x-superset-user: &superset-user root
x-superset-depends-on: &superset-depends-on
- db
- redis
x-superset-volumes: &superset-volumes
# /app/pythonpath_docker will be appended to the PYTHONPATH in the final container
- ./docker:/app/docker
- ./superset:/app/superset
- ./superset-frontend:/app/superset-frontend
- superset_home:/app/superset_home
- ./tests:/app/tests
version: "3.7"
services:
redis:
image: redis:latest
container_name: superset_cache
restart: unless-stopped
ports:
- "127.0.0.1:6379:6379"
volumes:
- redis:/data
db:
env_file: docker/.env
image: postgres:14
container_name: superset_db
restart: unless-stopped
ports:
- "127.0.0.1:5432:5432"
volumes:
- db_home:/var/lib/postgresql/data
superset:
env_file: docker/.env
image: *superset-image
container_name: superset_app
command: ["/app/docker/docker-bootstrap.sh", "app"]
restart: unless-stopped
ports:
- 8088:8088
user: *superset-user
depends_on: *superset-depends-on
volumes: *superset-volumes
environment:
CYPRESS_CONFIG: "${CYPRESS_CONFIG}"
superset-websocket:
container_name: superset_websocket
build: ./superset-websocket
image: superset-websocket
ports:
- 8080:8080
depends_on:
- redis
# Mount everything in superset-websocket into container and
# then exclude node_modules and dist with bogus volume mount.
# This is necessary because host and container need to have
# their own, separate versions of these files. .dockerignore
# does not seem to work when starting the service through
# docker-compose.
#
# For example, node_modules may contain libs with native bindings.
# Those bindings need to be compiled for each OS and the container
# OS is not necessarily the same as host OS.
volumes:
- ./superset-websocket:/home/superset-websocket
- /home/superset-websocket/node_modules
- /home/superset-websocket/dist
environment:
- PORT=8080
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_SSL=false
superset-init:
image: *superset-image
container_name: superset_init
command: ["/app/docker/docker-init.sh"]
env_file: docker/.env
depends_on: *superset-depends-on
user: *superset-user
volumes: *superset-volumes
environment:
CYPRESS_CONFIG: "${CYPRESS_CONFIG}"
superset-node:
image: node:16
container_name: superset_node
command: ["/app/docker/docker-frontend.sh"]
env_file: docker/.env
depends_on: *superset-depends-on
volumes: *superset-volumes
superset-worker:
image: *superset-image
container_name: superset_worker
command: ["/app/docker/docker-bootstrap.sh", "worker"]
env_file: docker/.env
restart: unless-stopped
depends_on: *superset-depends-on
user: *superset-user
volumes: *superset-volumes
# Bump memory limit if processing selenium / thumbnails on superset-worker
# mem_limit: 2038m
# mem_reservation: 128M
superset-worker-beat:
image: *superset-image
container_name: superset_worker_beat
command: ["/app/docker/docker-bootstrap.sh", "beat"]
env_file: docker/.env
restart: unless-stopped
depends_on: *superset-depends-on
user: *superset-user
volumes: *superset-volumes
superset-tests-worker:
image: *superset-image
container_name: superset_tests_worker
command: ["/app/docker/docker-bootstrap.sh", "worker"]
env_file: docker/.env
environment:
DATABASE_HOST: localhost
DATABASE_DB: test
REDIS_CELERY_DB: 2
REDIS_RESULTS_DB: 3
REDIS_HOST: localhost
network_mode: host
depends_on: *superset-depends-on
user: *superset-user
volumes: *superset-volumes
volumes:
superset_home:
external: false
db_home:
external: false
redis:
external: false
and here is the docker-compose-non-dev.yml file,
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
x-superset-image: &superset-image apache/superset:${TAG:-latest-dev}
x-superset-depends-on: &superset-depends-on
- db
- redis
x-superset-volumes: &superset-volumes
# /app/pythonpath_docker will be appended to the PYTHONPATH in the final container
- ./docker:/app/docker
- superset_home:/app/superset_home
version: "3.7"
services:
redis:
image: redis:latest
container_name: superset_cache
restart: unless-stopped
volumes:
- redis:/data
db:
env_file: docker/.env-non-dev
image: postgres:14
container_name: superset_db
restart: unless-stopped
volumes:
- db_home:/var/lib/postgresql/data
superset:
env_file: docker/.env-non-dev
image: *superset-image
container_name: superset_app
command: ["/app/docker/docker-bootstrap.sh", "app-gunicorn"]
user: "root"
restart: unless-stopped
ports:
- 8088:8088
depends_on: *superset-depends-on
volumes: *superset-volumes
superset-init:
image: *superset-image
container_name: superset_init
command: ["/app/docker/docker-init.sh"]
env_file: docker/.env-non-dev
depends_on: *superset-depends-on
user: "root"
volumes: *superset-volumes
superset-worker:
image: *superset-image
container_name: superset_worker
command: ["/app/docker/docker-bootstrap.sh", "worker"]
env_file: docker/.env-non-dev
restart: unless-stopped
depends_on: *superset-depends-on
user: "root"
volumes: *superset-volumes
superset-worker-beat:
image: *superset-image
container_name: superset_worker_beat
command: ["/app/docker/docker-bootstrap.sh", "beat"]
env_file: docker/.env-non-dev
restart: unless-stopped
depends_on: *superset-depends-on
user: "root"
volumes: *superset-volumes
volumes:
superset_home:
external: false
db_home:
external: false
redis:
external: false
Is there any alternative way to make it work in the local env?

Related

Pimcore Unsupported config option for services

In official pimcore document below docker-compose.yaml file is available but when i execute
following command. I am getting error.
ERROR: The Compose file './docker-compose.yaml' is invalid because:
Unsupported config option for services: 'nginx'
Unsupported config option for volumes: 'pimcore-database'
I checked all indentation. they are correct can anyone help below
Here is the official installation guide:
https://github.com/pimcore/demo
services:
redis:
image: redis:alpine
command: [ redis-server, --maxmemory 128mb, --maxmemory-policy volatile-lru, --save "" ]
db:
image: mariadb:10.7
working_dir: /application
command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci, --innodb-file-per-table=1]
volumes:
- pimcore-database:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=ROOT
- MYSQL_DATABASE=pimcore
- MYSQL_USER=pimcore
- MYSQL_PASSWORD=pimcore
nginx:
image: nginx:stable-alpine
ports:
- "8080:80"
volumes:
- .:/var/www/html:ro
- ./.docker/nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- php-fpm
- php-fpm-debug
php-fpm:
user: '1000:1000' # set to your uid:gid
image: pimcore/pimcore:PHP8.1-fpm
environment:
COMPOSER_HOME: /var/www/html
depends_on:
- db
volumes:
- .:/var/www/html
- pimcore-tmp-storage:/tmp
php-fpm-debug:
user: '1000:1000' # set to your uid:gid
image: pimcore/pimcore:PHP8.1-fpm-debug
depends_on:
- db
volumes:
- .:/var/www/html
- pimcore-tmp-storage:/tmp
environment:
PHP_IDE_CONFIG: serverName=localhost
COMPOSER_HOME: /var/www/html
supervisord:
user: '1000:1000' # set to your uid:gid
image: pimcore/pimcore:PHP8.1-supervisord
depends_on:
- db
volumes:
- .:/var/www/html
- ./.docker/supervisord.conf:/etc/supervisor/conf.d/pimcore.conf:ro
volumes:
pimcore-database:
pimcore-tmp-storage:
David Maze comment was on point. You must also consider to specify a supported version, because 3.8 is the last version right now, but maybe won't work in your case. For example, in my case (the docker-compose.yaml for the Pimcore demo project) the version is 3.3.
The solution that I found it was adding the version tag in the YML file:
version: '3'
services:
redis:
image: redis:alpine
command: [ redis-server, --maxmemory 128mb, --maxmemory-policy volatile-lru, --save "" ]
...

Cant create a number format in Docker using Apache Superset

I am trying to create a BRL number format (R$123,345,789.22) for my big number charts but i don't know how to do that... I looked at this solution here: Customise the number format in Apache superset but I can't make it work. I think it is because the superset is installed locally via docker containers so it just downloads the images and it doesn't matter if I change my local superset files it doesn't change anything in the app (don't know much about docker btw). here is the docker-compose file to build superset
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
x-superset-image: &superset-image apache/superset:${TAG:-latest-dev}
x-superset-depends-on: &superset-depends-on
- db
- redis
x-superset-volumes: &superset-volumes
# /app/pythonpath_docker will be appended to the PYTHONPATH in the final container
- ./docker:/app/docker
- superset_home:/app/superset_home
version: "3.7"
services:
redis:
image: redis:latest
container_name: superset_cache
restart: unless-stopped
volumes:
- redis:/data
db:
env_file: docker/.env-non-dev
image: postgres:10
container_name: superset_db
restart: unless-stopped
volumes:
- db_home:/var/lib/postgresql/data
superset:
env_file: docker/.env-non-dev
image: *superset-image
container_name: superset_app
command: ["/app/docker/docker-bootstrap.sh", "app-gunicorn"]
user: "root"
restart: unless-stopped
ports:
- 8088:8088
depends_on: *superset-depends-on
volumes: *superset-volumes
superset-init:
image: *superset-image
container_name: superset_init
command: ["/app/docker/docker-init.sh"]
env_file: docker/.env-non-dev
depends_on: *superset-depends-on
user: "root"
volumes: *superset-volumes
superset-worker:
image: *superset-image
container_name: superset_worker
command: ["/app/docker/docker-bootstrap.sh", "worker"]
env_file: docker/.env-non-dev
restart: unless-stopped
depends_on: *superset-depends-on
user: "root"
volumes: *superset-volumes
superset-worker-beat:
image: *superset-image
container_name: superset_worker_beat
command: ["/app/docker/docker-bootstrap.sh", "beat"]
env_file: docker/.env-non-dev
restart: unless-stopped
depends_on: *superset-depends-on
user: "root"
volumes: *superset-volumes
volumes:
superset_home:
external: false
db_home:
external: false
redis:
external: false
the modified file as in Customise the number format in Apache superset :
import {
createDurationFormatter,
createD3NumberFormatter,
getNumberFormatter,
getNumberFormatterRegistry,
NumberFormats,
getTimeFormatterRegistry,
smartDateFormatter,
smartDateVerboseFormatter,
} from '#superset-ui/core';
export default function setupFormatters() {
getNumberFormatterRegistry()
// Add shims for format strings that are deprecated or common typos.
// Temporary solution until performing a db migration to fix this.
.registerValue(',0', getNumberFormatter(',.4~f'))
.registerValue('null', getNumberFormatter(',.4~f'))
.registerValue('%', getNumberFormatter('.0%'))
.registerValue('.', getNumberFormatter('.4~f'))
.registerValue(',f', getNumberFormatter(',d'))
.registerValue(',r', getNumberFormatter(',.4f'))
.registerValue('0f', getNumberFormatter(',d'))
.registerValue(',#', getNumberFormatter(',.4~f'))
.registerValue('$,f', getNumberFormatter('$,d'))
.registerValue('0%', getNumberFormatter('.0%'))
.registerValue('f', getNumberFormatter(',d'))
.registerValue(',.', getNumberFormatter(',.4~f'))
.registerValue('.1%f', getNumberFormatter('.1%'))
.registerValue('1%', getNumberFormatter('.0%'))
.registerValue('3%', getNumberFormatter('.0%'))
.registerValue(',%', getNumberFormatter(',.0%'))
.registerValue('.r', getNumberFormatter('.4~f'))
.registerValue('$,.0', getNumberFormatter('$,d'))
.registerValue('$,.1', getNumberFormatter('$,.1~f'))
.registerValue(',0s', getNumberFormatter(',.4~f'))
.registerValue('%%%', getNumberFormatter('.0%'))
.registerValue(',0f', getNumberFormatter(',d'))
.registerValue('+,%', getNumberFormatter('+,.0%'))
.registerValue('$f', getNumberFormatter('$,d'))
.registerValue('+,', getNumberFormatter(NumberFormats.INTEGER_SIGNED))
.registerValue(',2f', getNumberFormatter(',.4~f'))
.registerValue(',g', getNumberFormatter(',.4~f'))
.registerValue('int', getNumberFormatter(NumberFormats.INTEGER))
.registerValue('.0%f', getNumberFormatter('.1%'))
.registerValue('$,0', getNumberFormatter('$,.4f'))
.registerValue('$,0f', getNumberFormatter('$,.4f'))
.registerValue('$,.f', getNumberFormatter('$,.4f'))
.registerValue('DURATION', createDurationFormatter())
.registerValue(
'DURATION_SUB',
createDurationFormatter({ formatSubMilliseconds: true }),
);
.registerValue(
'CURRENCY_BRAZIL',
createD3NumberFormatter({
locale: {
decimal: ',',
thousands: '.',
currency: ['R$', ''],
},
formatString: '$,.2f',
}),
)
getTimeFormatterRegistry()
.registerValue('smart_date', smartDateFormatter)
.registerValue('smart_date_verbose', smartDateVerboseFormatter)
.setDefaultKey('smart_date');
}
so my question is: How can i create a custom number format on docker superset?
I have got this answer from a fellow gentleman made-of-imposter-syndr :
" From what I can see, you are using docker-compose-non-dev.yml as your compose file, which uses pre-built frontend assets, which is why you are not able to see the changes you make.
Try running docker-compose -f docker-compose.yml up or simply, docker-compose up (If a file with the name docker-compose.yml file exists, docker-compose up automatically picks that up)"
however, I tried running "docker-compose up" to run superset but now whenever I go to localhost:8088 it shows a weird blank screen:
blank screen
so I cant run superset using docker-compose.yml, it only runs with docker-compose-non-dev.yml but as mentioned above apparently I can't change the code that way.
this is the link of the docker-compose up output logs on my terminal:
https://pastebin.com/iyFBbWdM
can someone help me solve this blank screen?
From what I can see, you are using docker-compose-non-dev.yml as your compose file, which uses pre-built frontend assets, which is why you are not able to see the changes you make.
Try running docker-compose -f docker-compose.yml up or simply, docker-compose up (If a file with the name docker-compose.yml file exists, docker-compose up automatically picks that up)
More information about that here, in superset documentation
If you are interested in learning more about docker in general, this tutorial was quite useful for me

Druid Docker different than Local Druid

Goal:
I am testing out different distributions of Apache Druid. My goal is to eventually use Druid in a docker-compose setup.
Expected Results:
Druid 0.21.1 installed and run locally (with start-micro-quickstart) is the same as Druid 0.21.1 run with docker-compose.
Actual results:
Druid installed and run locally has a data ingestion page that looks like this:
The docker-compose.yml from the Druid repository does not run as is because it references a druid:0.22.0 image when 0.21.1 is the latest available. When the references to 0.22.0 are changes to 0.21.0, docker-compose succeeds, but the data ingestion page looks like this:
Note specifically the lack of native support for Apache Kafka data ingestion which is what I am using.
Question:
Why are the local and docker builds different? Is there any way to get the start-micro-quickstart version in docker?
docker-compose.yml:
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
version: "2.2"
volumes:
metadata_data: {}
middle_var: {}
historical_var: {}
broker_var: {}
coordinator_var: {}
router_var: {}
druid_shared: {}
services:
postgres:
container_name: postgres
image: postgres:latest
volumes:
- metadata_data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=FoolishPassword
- POSTGRES_USER=druid
- POSTGRES_DB=druid
# Need 3.5 or later for container nodes
zookeeper:
container_name: zookeeper
image: zookeeper:3.5
ports:
- "2181:2181"
environment:
- ZOO_MY_ID=1
coordinator:
image: apache/druid:0.21.1
container_name: coordinator
volumes:
- druid_shared:/opt/shared
- coordinator_var:/opt/druid/var
depends_on:
- zookeeper
- postgres
ports:
- "8081:8081"
command:
- coordinator
env_file:
- environment
broker:
image: apache/druid:0.21.1
container_name: broker
volumes:
- broker_var:/opt/druid/var
depends_on:
- zookeeper
- postgres
- coordinator
ports:
- "8082:8082"
command:
- broker
env_file:
- environment
historical:
image: apache/druid:0.21.1
container_name: historical
volumes:
- druid_shared:/opt/shared
- historical_var:/opt/druid/var
depends_on:
- zookeeper
- postgres
- coordinator
ports:
- "8083:8083"
command:
- historical
env_file:
- environment
middlemanager:
image: apache/druid:0.21.1
container_name: middlemanager
volumes:
- druid_shared:/opt/shared
- middle_var:/opt/druid/var
depends_on:
- zookeeper
- postgres
- coordinator
ports:
- "8091:8091"
- "8100-8105:8100-8105"
command:
- middleManager
env_file:
- environment
router:
image: apache/druid:0.21.1
container_name: router
volumes:
- router_var:/opt/druid/var
depends_on:
- zookeeper
- postgres
- coordinator
ports:
- "8888:8888"
command:
- router
env_file:
- environment
Edit: After restarting the docker container, it now matches the local Druid build. I have no idea why I got the other version initially, but if you have this problem try restarting the container.
If anyone has a real answer please add it, but I don't want to leave this open.

Cypress not connecting to localhost

I have a docker compose file that holds my cypress container:
version: '3'
services:
redis:
image: redis
ports:
- "6379"
# restart: unless-stopped
networks:
main:
aliases:
- redis
postgres:
image: postgres:12
ports:
- "5432:5432"
env_file: ./.env
# restart: unless-stopped
volumes:
- pgdata:/var/lib/postgresql/data
networks:
main:
aliases:
- postgres
#access by going to localhost:16543
#when adding a server to the serve list
#the hostname is postgres
#the username is postgres
#the password is postgres
pgadmin:
image: dpage/pgadmin4
links:
- postgres
depends_on:
- postgres
env_file: ./.env
# restart: unless-stopped
ports:
- "16543:80"
networks:
main:
aliases:
- pgadmin
celery:
build:
context: .
dockerfile: Dockerfile-dev # use docker-dev because production npm installs and npm builds
command: python manage.py celery
env_file: ./.env
# restart: unless-stopped
volumes:
- .:/code
- tmp:/tmp
links:
- redis
depends_on:
- redis
networks:
main:
aliases:
- celery
web:
build:
context: .
dockerfile: Dockerfile-dev
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
- tmp:/tmp
ports:
- "8000:8000"
env_file: ./.env
# restart: unless-stopped
links:
- postgres
- redis
- celery
- pgadmin
depends_on:
- postgres
- redis
- celery
- pgadmin
networks:
main:
aliases:
- web
# Cypress container
cypress:
# the Docker image to use from https://github.com/cypress-io/cypress-docker-images
image: "cypress/included:4.0.2"
depends_on:
- web
environment:
# pass base url to test pointing at the web application
- CYPRESS_BASE_URL=http://web:8000
# share the current folder as volume to avoid copying
working_dir: /e2e
volumes:
- ./:/e2e
networks:
main:
aliases:
- cypress
volumes:
pgdata:
tmp:
networks:
main:
For some reason when I start my server and then start cypress using docker-compose up --exit-code-from cypress I get the following error, that I cannot seem to debug, please note my server is running, and all are on the same network main
Cypress could not verify that this server is running:
> http://web:8000
We are verifying this server because it has been configured as your `baseUrl`.
Cypress automatically waits until your server is accessible before running tests.
We will try connecting to it 3 more times...
====================================================================================================
(Run Starting)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 4.0.2 │
│ Browser: Electron 78 (headless) │
│ Specs: 1 found (login/test.spec.js) │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: login/test.spec.js (1 of 1)
Browserslist: caniuse-lite is outdated. Please run the following command: `yarn upgrade`
Login Page
1) Visits Page
0 passing (671ms)
1 failing
1) Login Page Visits Page:
CypressError: cy.visit() failed trying to load:
http://127.0.0.1:8000/test/
We attempted to make an http request to this URL but the request failed without a response.
We received this error at the network level:
> Error: connect ECONNREFUSED 127.0.0.1:8000
Common situations why this would fail:
- you don't have internet access
- you forgot to run / boot your web server
- your web server isn't accessible
- you have weird network configuration settings on your computer
The stack trace for this error is:
Error: connect ECONNREFUSED 127.0.0.1:8000
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14)

Can not send post request to nuxeo server over docker container

I can send post request to Nuxeo server using http://localhost:8080 base address from local. When I add docker support to my app, my app can not send post request to nuxeo server using http://nuxeo_container_name:80 base address. It returns badRequest. How can I solve it? Nuxeo server and app are in the same docker network.
This is my docker-compose for nuxeo server. I use nuxeo_app_server in my app as nuxeo container name.
version: "3.5"
networks:
nuxnet:
name: network
services:
nginx:
container_name: nuxeo_app_server
build: nginx
ports:
# For localhost use, the exposed nginx port
# must match the localhost:port below in NUXEO_URL
- "8080:80"
#- "443:443"
cap_add:
- NET_BIND_SERVICE
links:
- nuxeo1
# - nuxeo2
environment:
USE_STAGING: 1
# default is 4096, but gcloud requires 2048
KEYSIZE: 2048
DOMAIN_LIST: /etc/nginx/conf.d/domains.txt
devices:
- "/dev/urandom:/dev/random"
sysctls:
- net.core.somaxconn=511
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d:ro
- certs:/etc/ssl/acme
networks:
- nuxnet
restart: always
nuxeo1:
image: nuxeo
hostname: nuxeo1
links:
- redis
- es
- db
env_file:
- ./nuxeo/setup.env
environment:
# Each nuxeo container must have a unique cluster id
NUXEO_CLUSTER_ID: 1
# URL that a user would use to access nuxeo UI or API
# For localhost urls, the port must match the exposted nginx port above
NUXEO_URL: http://localhost:8080/nuxeo
# JAVA memory tuning -Xms, -Xmx
JVM_MS: 1024m
JVM_MX: 2048m
devices:
- "/dev/urandom:/dev/random"
volumes:
- ./nuxeo/init:/docker-entrypoint-initnuxeo.d:ro
- app-data:/var/lib/nuxeo
- app-logs:/var/log/nuxeo
networks:
- nuxnet
restart: always
redis:
# note: based on alpine:3.6
# see https://hub.docker.com/_/redis/
image: redis:3.2-alpine
volumes:
- redis-data:/data
networks:
- nuxnet
restart: always
es:
image: elasticsearch:2.4-alpine
volumes:
- es-data:/usr/share/elasticsearch/data
- es-plugins:/usr/share/elasticsearch/plugins
- es-config:/usr/share/elasticsearch/config
- ./elasticsearch/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
environment:
# settings below add -Xms400m -Xmx1g
ES_MIN_MEM: 500m
EX_MAX_MEM: 1g
security_opt:
- seccomp:unconfined
networks:
- nuxnet
restart: always
db:
image: postgres:9.6-alpine
# note mem tuning suggestions in the following two links
# https://doc.nuxeo.com/nxdoc/postgresql/
# https://doc.nuxeo.com/nxdoc/postgresql/#adapt-your-configuration-to-your-hardware
environment:
POSTGRES_USER: nuxeo
POSTGRES_PASSWORD: nuxeo
POSTGRES_DB: nuxeo
POSTGRES_INITDB_ARGS: "-E UTF8"
PGDATA: /var/lib/postgresql/data
volumes:
- db-store:/var/lib/postgresql/data
- ./postgresql/postgresql.conf:/etc/postgresql.conf:ro
command: postgres -c config_file=/etc/postgresql.conf
networks:
- nuxnet
restart: always
volumes:
# to view current data, run bin/view-data.sh
certs:
app-logs: # all server logs, can be shared between instances
app-data: # contains app data and packages (store cache), can be shared between instances
db-store: # postgres database
es-data:
es-plugins:
es-config:
redis-data:
I succeed to make REST request between two containers using container name and default port.
Did you try with URL : http://nuxeo1:8080 ?

Resources