-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored modeler dockerfiles/docker compose files (#75)
* removed additional dockerfilesadded docker-compose.debug file following new conventionsmoved server source to /source foldermoved thrift source to /source/thrift folder * change back to qxapp use build target on client for production (almost 2x faster in chrome debugger) fixed production docker * removed _dockerfiles folder * updated path to thrift
- Loading branch information
Showing
17 changed files
with
78 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM node:8.9.2 AS common | ||
ENV NPM_CONFIG_LOGLEVEL warn | ||
# + /home/node/ | ||
# + app/source-output/ | ||
# + app/source/ | ||
# + app/*.json | ||
|
||
WORKDIR /home/node/ | ||
RUN npm install qxcompiler | ||
|
||
ENV PATH="/home/node/node_modules/.bin/:${PATH}" | ||
|
||
WORKDIR /home/node/qxapp | ||
|
||
#-----------------Development----------------------- | ||
FROM common as development | ||
|
||
CMD ["qx", "compile", "--watch"] | ||
|
||
#-----------------Production---------------------- | ||
FROM common AS production | ||
|
||
COPY source /home/node/qxapp/source | ||
COPY *.json ./ | ||
RUN qx compile --target=build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# USAGE: docker-compose -f docker-compose.yml -f docker-compose.debug.yml ... | ||
version: '3.4' | ||
services: | ||
client: | ||
build: | ||
target: development | ||
image: client-dev | ||
volumes: | ||
- './client:/home/node/qxapp' | ||
server: | ||
build: | ||
target: development | ||
image: server-dev | ||
ports: | ||
- '8080:9090' | ||
volumes: | ||
- './server/source:/home/node/source' | ||
- './client/source-output:/home/node/source-output' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
version: '3' | ||
version: '3.4' | ||
services: | ||
qxapp: | ||
client: | ||
build: | ||
context: . | ||
dockerfile: _dockerfiles/qxapp/node/Dockerfile | ||
context: client | ||
target: production | ||
image: client-prod | ||
server: | ||
build: | ||
context: server | ||
args: | ||
web_app_port: 9090 | ||
s4l_ip: "172.16.9.89" | ||
s4l_port_app: 9095 | ||
s4l_port_mod: 9096 | ||
target: production | ||
image: server-prod | ||
ports: | ||
- '8080:9090' | ||
depends_on: | ||
- client |
50 changes: 20 additions & 30 deletions
50
...deling/_dockerfiles/qxapp/node/Dockerfile β services/dy-modeling/server/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,42 @@ | ||
# Compilation stage ---- | ||
FROM node:8.9.2 | ||
|
||
LABEL maintainer=pcrespov | ||
FROM node:8.9.2 AS common | ||
|
||
ENV NPM_CONFIG_LOGLEVEL warn | ||
|
||
WORKDIR /home/node/ | ||
# https://www.npmjs.com/package/qxcompiler | ||
RUN npm install qxcompiler | ||
|
||
# TODO: why to create again? not better taking entire client?? | ||
ENV PATH="/home/node/node_modules/.bin/:${PATH}" | ||
#RUN qx create qxapp -I --qxpath /home/node/node_modules/qooxdoo-sdk/framework/ | ||
|
||
WORKDIR /home/node/qxapp | ||
COPY client/source source | ||
COPY client/*.json ./ | ||
RUN qx compile | ||
|
||
|
||
# Deployment stage ----- | ||
FROM node:8.9.2 | ||
|
||
# Web server variables | ||
ARG web_app_port=8080 | ||
ENV SIMCORE_WEB_HOSTNAME "0.0.0.0" | ||
ENV SIMCORE_WEB_PORT $web_app_port | ||
ENV SIMCORE_WEB_OUTDIR /home/node/source-output | ||
EXPOSE $web_app_port | ||
LABEL simcore.service.settings='[{"name": "ports", "type": "int", "value": 9090}, {"name": "constraints", "type": "string", "value": ["node.platform.os == linux"]}, {"name": "env", "type": "string", "value": ["CS_S4L_HOSTNAME=xrpc-worker_%service_uuid%"]}]' | ||
|
||
# S4L as CompServ variables | ||
# S4L host and ports | ||
ARG s4l_ip="0.0.0.0" | ||
ARG s4l_port_app="9095" | ||
ARG s4l_port_mod="9096" | ||
ENV CS_S4L_HOSTNAME $s4l_ip | ||
ENV CS_S4L_PORT_APP $s4l_port_app | ||
ENV CS_S4L_PORT_MOD $s4l_port_mod | ||
|
||
# + /home/node/ json files | ||
# + source-output/ client source files | ||
# + source/ server source files | ||
WORKDIR /home/node/ | ||
COPY --from=0 /home/node/qxapp/source-output source-output | ||
COPY server . | ||
COPY package.json /home/node/package.json | ||
VOLUME /home/node/source-output | ||
#--------------------Development------------------ | ||
FROM common AS development | ||
|
||
# TODO ensure [email protected] | ||
RUN npm install -y \ | ||
&& npm install promise \ | ||
&& echo node $(node --version) \ | ||
&& echo npm $(npm --version) | ||
&& npm install nodemon -g | ||
|
||
EXPOSE $web_app_port | ||
CMD ["nodemon", "-L", "start"] | ||
|
||
#---------------------Production------------------ | ||
FROM common AS production | ||
WORKDIR /home/node/ | ||
COPY --from=client-prod:latest /home/node/qxapp/build-output source-output | ||
COPY source /home/node/source | ||
RUN npm install -y | ||
|
||
CMD ["npm", "start"] | ||
ENTRYPOINT ["npm", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.