Commit 373f90a0 authored by root's avatar root

Docker build in CI, use nginx for web server

Also include an experimental docker-cloud.yml config for 'docker stack'
deployments.
parent 5d22bf87
......@@ -16,4 +16,28 @@ test_web:
script:
- cd schedules_web
- yarn
- yarn build
\ No newline at end of file
- yarn build
build_web:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- mkdir -p /root/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /root/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR/schedules_web --dockerfile $CI_PROJECT_DIR/schedules_web/Dockerfile --destination $CI_REGISTRY_IMAGE/web:$CI_COMMIT_TAG
only:
- tags
build_api:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- mkdir -p /root/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /root/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR/schedules_api --dockerfile $CI_PROJECT_DIR/schedules_api/Dockerfile --destination $CI_REGISTRY_IMAGE/api:$CI_COMMIT_TAG
only:
- tags
version: "3.3"
volumes:
dbdata:
configs:
nginx_conf:
file: ./schedules_web/nginx.conf
networks:
front:
back:
services:
api:
image: registry.srct.gmu.edu/srct/schedules/api:0.1.0
networks:
back:
web:
image: registry.srct.gmu.edu/srct/schedules/web:0.1.0
networks:
front:
back:
volumes:
- ./schedules_web:/web
ports:
- 8085:80
FROM node:9
RUN mkdir /web
COPY . /web
WORKDIR /web
ADD . /web
EXPOSE 8080
RUN yarn install && yarn run prod
RUN yarn
\ No newline at end of file
FROM nginx:1.15.0
COPY --from=0 /web/dist /web
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