Skip to content

Commit

Permalink
debug s2i process
Browse files Browse the repository at this point in the history
  • Loading branch information
startxfr committed Mar 3, 2018
1 parent 63196d4 commit f801467
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
5 changes: 4 additions & 1 deletion .s2i/assemble
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
#

cd $APP_PATH
cp -R /tmp/src/* $APP_PATH/
if[[ -d /tmp/src ]]; then
cp -R /tmp/src/* $APP_PATH/
# rm -rf /tmp/src
fi;
npm install -production
npm dedupe
npm cache verify
Expand Down
15 changes: 7 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,26 @@ LABEL name="startx/sxapi-$SXAPI_VERSION" \
io.openshift.expose-services="8080:http" \
io.openshift.s2i.destination="/tmp" \
io.openshift.s2i.scripts-url="image:///s2i" \
fr.startx.component="$SX_ID:$SX_VERSION"
fr.startx.component="$SX_ID:$SXAPI_VERSION"

COPY .s2i /s2i
COPY ./core $APP_PATH/core
COPY ./test $APP_PATH/test
COPY ./*.j* $APP_PATH/
COPY ./app.js $APP_PATH/app.js
COPY ./package.json $APP_PATH/package.json
COPY ./sxapi.json $CONF_PATH/sxapi.json

RUN apk update && apk upgrade && apk add git python make gcc g++ \
&& mkdir -p $APP_PATH \
&& mkdir -p $CONF_PATH \
&& mkdir -p $DATA_PATH \
&& mkdir -p $APP_PATH $CONF_PATH $DATA_PATH /.npm /.config \
&& cd $APP_PATH \
&& npm install \
&& npm dedupe \
&& npm cache verify \
&& npm cache clean --force \
&& apk del make gcc g++ \
&& chgrp -R 0 $APP_PATH $CONF_PATH $DATA_PATH /s2i \
&& chown -R 1001:0 $APP_PATH $CONF_PATH $DATA_PATH /s2i \
&& chmod -R g=u $APP_PATH $CONF_PATH $DATA_PATH /s2i
&& chgrp -R 0 $APP_PATH $CONF_PATH $DATA_PATH /s2i /.npm /.config \
&& chown -R 1001:0 $APP_PATH $CONF_PATH $DATA_PATH /s2i /.npm /.config \
&& chmod -R g=u $APP_PATH $CONF_PATH $DATA_PATH /s2i /.npm /.config

USER 1001
EXPOSE 8080
Expand Down
8 changes: 4 additions & 4 deletions openshift-template-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"metadata": {
"name": "sxapi",
"annotations": {
"openshift.io/display-name": "Startx SXAPI framework",
"openshift.io/display-name": "Startx SXAPI framework (S2I)",
"openshift.io/generated-by": "STARTX"
},
"labels": {
Expand All @@ -40,8 +40,8 @@
{
"name": "latest",
"annotations": {
"openshift.io/display-name": "Startx SXAPI framework (latest)",
"description": "Simple and extensible API framework based on alpine (latest)",
"openshift.io/display-name": "S2I Startx SXAPI framework (latest)",
"description": "Builder for Simple and eXtensible API framework based on alpine (latest)",
"iconClass": "icon-nodejs",
"tags": "builder,startx,alpine,nodejs,sxapi-latest",
"supports": "sxapi:latest,nodejs,http",
Expand Down Expand Up @@ -159,7 +159,7 @@
"containers": [
{
"name": "${APP_NAME}",
"image": "startx/sxapi@sha256:fdeea7651d752e09fd9d6e760e85ef7667f7e443c9712d0e5f051c105e66bf05",
"image": "startx/sxapi@sha256:d39be654d7336f665e8901c543ebf363baff093c5d21d6d24e4a3405629eeb40",
"command": [
"start"
],
Expand Down

0 comments on commit f801467

Please sign in to comment.