Browse Source

Add dockerfile and build docker image in CI

tags/v0.3.2
Vildravn 5 years ago
parent
commit
34352265c5
2 changed files with 38 additions and 1 deletions
  1. +18
    -1
      .gitlab-ci.yml
  2. +20
    -0
      Dockerfile

+ 18
- 1
.gitlab-ci.yml View File

@@ -2,6 +2,7 @@ image: node:lts-jessie

stages:
- test
- build

audit:
stage: test
@@ -30,4 +31,20 @@ lint-client:
- eslint .
only:
- merge_requests
- master
- master

build-image:
stage: build
image: docker:stable
services:
- docker:dind
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
script:
- docker build -t $IMAGE_TAG .
- docker push $IMAGE_TAG
only:
- master
- tags

+ 20
- 0
Dockerfile View File

@@ -0,0 +1,20 @@
# Base image on Node.js 10.x LTS (dubnium)
FROM node:10

# Create app directory
WORKDIR /usr/src/isleward

# Bundle app source
COPY . .

# Change directory to src/server/
WORKDIR /usr/src/isleward/src/server/

# Install npm modules specified in package.json
RUN npm install --only-production

# Expose container's port 4000
EXPOSE 4000

# Launch Isleward server
CMD ["node", "--expose-gc", "index.js"]

Loading…
Cancel
Save