Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
schedules
Commits
1b2223e1
Commit
1b2223e1
authored
Aug 31, 2018
by
Nicholas J Anderson
Committed by
Zac Wood
Aug 31, 2018
Browse files
Docker build in CI, use nginx for 'web' image
parent
df77d0e7
Changes
4
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
1b2223e1
stages
:
-
test
-
build
test_api
:
image
:
ruby:2.5
...
...
@@ -16,4 +17,30 @@ test_web:
script
:
-
cd schedules_web
-
yarn
-
yarn build
\ No newline at end of file
-
yarn build
build_web
:
stage
:
build
retry
:
2
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
retry
:
2
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
docker-cloud.yml
0 → 100644
View file @
1b2223e1
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
schedules_api/Dockerfile
View file @
1b2223e1
...
...
@@ -6,6 +6,8 @@ ADD . /api
EXPOSE
3000
ENV
RAILS_ENV production
RUN
bundle
install
RUN
rails db:migrate
RUN
rails db:seed
schedules_web/Dockerfile
View file @
1b2223e1
FROM
node:9
RUN
mkdir
/web
COPY
.
/web
WORKDIR
/web
ADD
. /web
EXPOSE
8080
RUN
yarn
install
&&
yarn run build
RUN
yarn
RUN
yarn build
FROM
nginx:1.15.0
COPY
--from=0 /web/dist /web
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment