Commit 92f9fd1f authored by Matheus Horstmann's avatar Matheus Horstmann 🐴

Issue #6: Update to node 10 and Dockerize project

Signed-off-by: Matheus Horstmann's avatarMatheus Horstmann <mch15@inf.ufpr.br>
parent 22220644
Pipeline #19207 passed with stages
in 44 seconds
.git
.dockerignore
docker-compose.yml
docker-compose.yaml
Dockerfile
.env*
package-lock.json
node_modules
*.bak
FORM_CREATOR_API_NODE_ENV=development
......@@ -13,4 +13,5 @@
/coverage
/build
/dist
*.bak
.env
image: node:6.12.2
image: node:10-stretch
cache:
paths:
......@@ -6,6 +6,8 @@ cache:
stages:
- test
- build
- deploy
run_test:
......@@ -17,3 +19,21 @@ run_test:
- yarn run lint
tags:
- node
build:
stage: build
script:
- docker build -t marula.c3sl.ufpr.br:5000/c3sl/simmctic-form-creator-api:v0.0.1 .
tags:
- docker
- build
deploy:
stage: deploy
script:
- docker push marula.c3sl.ufpr.br:5000/c3sl/simmctic-form-creator-api:v0.0.1
tags:
- docker
- build
only:
- master
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## 0.0.1 - 04-02-2019
### Added
- This CHANGELOG file to hopefully serve as an evolving example of a standardized open source project CHANGELOG.
- CI file to enable Gitlab Continuous Integration.
- Docker files, as Dockerfile and docker-compose, to make easy development and Deploy #6 (Horstmann).
- Update Node to 10.* #6 (Horstmann).
FROM node:10-stretch-slim
# Set an environment variable to store where the app is installed to inside of the Docker image.
ENV WORKSPACE /app
RUN mkdir -p $WORKSPACE
# Change WORKSPACE owner
RUN chown -R node:node $WORKSPACE
# Change running user
USER node
# This sets the context of where commands will be ran in and is documented
# on Docker's website extensively.
# Set app directory
WORKDIR $WORKSPACE
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY --chown=node:node package.json .
COPY --chown=node:node yarn.lock .
RUN yarn install --frozen-lockfile --silent --non-interactive
# If you are building your code for production
# RUN yarn install --production --frozen-lockfile --silent --non-interactive
# Bundle app source
COPY --chown=node:node . .
EXPOSE 3000
CMD [ "yarn", "start" ]
{
"name": "ts-api-start-up",
"name": "form-creator-api",
"version": "0.0.1",
"description": "Typescript (API) base project",
"description": "RESTful API used to manage and answer forms.",
"main": "index.js",
"scripts": {
"start": "scripts/start.sh config/config.env"
......
......@@ -55,4 +55,4 @@ app.delete("/item/:id", ItemCtrl.del);
// Listening
app.listen(port);
console.log("Server listening on port 3000");
console.log("Server listening on port " + port);
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment