Skip to content

Commit 2929dbb

Browse files
authored
fix: Add default ports and fix dashboard creation fails in docker (#1267)
* feat(cubejs-cli): Docker template - automatically port binding * fix(@cubejs-backend/server-core): PackageFetcher - automatically create node_modules when it doesnot exist * feat(docker): Use debian buster instead of alphine as base image
1 parent 2b3ca61 commit 2929dbb

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

packages/cubejs-cli/src/templates.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,14 @@ services:
223223
- redis
224224
# - postgres
225225
ports:
226-
- 4000
226+
# It's better to use random port binding for 4000/3000 ports
227+
# without it you will not able to start multiple projects inside docker
228+
# - 4000
229+
# - 3000
230+
# 4000 is a port for Cube.js API
231+
- 4000:4000
232+
# 3000 is a port for Playground web-server
233+
- 3000:3000
227234
volumes:
228235
# If you are going to use own dependencies, for example axios/vault or anything else for getting configuration
229236
# - .:/cube/conf

packages/cubejs-docker/dev.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:12.19-alpine
1+
FROM node:12.19
22

33
ENV CUBEJS_DOCKER_IMAGE_TAG=dev
44

packages/cubejs-docker/latest.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:12.19-alpine
1+
FROM node:12.19
22

33
ENV CUBEJS_DOCKER_IMAGE_TAG=latest
44

packages/cubejs-server-core/dev/PackageFetcher.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ class PackageFetcher {
1111
this.tmpFolderPath = path.resolve('.', 'node_modules', '.tmp');
1212

1313
try {
14-
fs.mkdirSync(this.tmpFolderPath);
14+
// Folder node_modules does not exist by default inside docker in /cube/conf without sharing volume for it
15+
fs.mkdirpSync(this.tmpFolderPath);
1516
} catch (err) {
1617
if (err.code === 'EEXIST') {
1718
fs.removeSync(this.tmpFolderPath);

0 commit comments

Comments
 (0)