Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/docker image #1940

Merged
merged 2 commits into from
Apr 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ FROM node:10-alpine
WORKDIR /usr/src/app

# Install dependencies
RUN apk --no-cache add g++ gcc libgcc libstdc++ linux-headers make python
RUN apk --no-cache add g++ gcc libgcc libstdc++ linux-headers make python tini
RUN npm install --quiet node-gyp -g
# Add Tini
ENTRYPOINT ["/sbin/tini", "--"]

# Install app dependencies
COPY package.json .
Expand All @@ -16,4 +18,6 @@ RUN npm ci --only=production
COPY . .

EXPOSE 80 8080
CMD [ "npm", "start" ]
WORKDIR "platform"
ENV NODE_ENV=production
CMD ["node", "serve.js"]
10 changes: 9 additions & 1 deletion gulpfile.js/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ function imageBuild() {
return sh(`docker build --tag ${config.image.current} .`);
}

/**
* Builds a local docker image for testing.
*/
function imageRunLocal() {
return sh(`docker run -d -p 8082:80 ${config.image.current}`);
}

/**
* Builds and uploads a docker image to Google Cloud Container Registry.
*/
Expand Down Expand Up @@ -156,9 +163,10 @@ function updateStop() {
exports.verifyTag = verifyTag;
exports.gcloudSetup = gcloudSetup;
exports.deploy = series(verifyTag, imageUpload, instanceTemplateCreate, updateStart);
exports.imageBuild = imageBuild;
exports.imageList = imageList;
exports.imageRunLocal = imageRunLocal;
exports.imageUpload = imageUpload;
exports.imageBuild = imageBuild;
exports.updateStop = updateStop;
exports.updateStatus = updateStatus;
exports.updateStart = updateStart;