Skip to content

Commit f33c433

Browse files
authored
feat: Containerize WebSocket server (apache#14514)
* feat: Containerize WebSocket server * Add license * Ensure Redis SSL is always turned off in dev
1 parent 37276e1 commit f33c433

File tree

4 files changed

+69
-0
lines changed

4 files changed

+69
-0
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@ install/
4343
superset-frontend/cypress-base/
4444
superset-frontend/coverage/
4545
superset/static/assets/
46+
superset-websocket/dist/
4647
venv

docker-compose.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,34 @@ services:
6161
environment:
6262
CYPRESS_CONFIG: "${CYPRESS_CONFIG}"
6363

64+
superset-websocket:
65+
container_name: superset_websocket
66+
build: ./superset-websocket
67+
image: superset-websocket
68+
ports:
69+
- 8080:8080
70+
depends_on:
71+
- redis
72+
# Mount everything in superset-websocket into container and
73+
# then exclude node_modules and dist with bogus volume mount.
74+
# This is necessary because host and container need to have
75+
# their own, separate versions of these files. .dockerignore
76+
# does not seem to work when starting the service through
77+
# docker-compose.
78+
#
79+
# For example, node_modules may contain libs with native bindings.
80+
# Those bindings need to be compiled for each OS and the container
81+
# OS is not necessarily the same as host OS.
82+
volumes:
83+
- ./superset-websocket:/home/superset-websocket
84+
- /home/superset-websocket/node_modules
85+
- /home/superset-websocket/dist
86+
environment:
87+
- PORT=8080
88+
- REDIS_HOST=redis
89+
- REDIS_PORT=6379
90+
- REDIS_SSL=false
91+
6492
superset-init:
6593
image: *superset-image
6694
container_name: superset_init

superset-websocket/.dockerignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
node_modules/
16+
dist/

superset-websocket/Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
FROM node:14.16.1
16+
17+
WORKDIR /home/superset-websocket
18+
19+
COPY . .
20+
21+
RUN npm ci
22+
RUN npm run build
23+
24+
CMD ["npm", "start"]

0 commit comments

Comments
 (0)