mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
backend as module;
frontend as Docker image; deployment configuration
This commit is contained in:
parent
2b801167c7
commit
e201f90867
4 changed files with 35 additions and 8 deletions
|
@ -5,17 +5,16 @@ services:
|
|||
|
||||
before_script:
|
||||
- docker info
|
||||
- mkdir build
|
||||
- mkdir node_modules
|
||||
- mkdir -p build
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- build
|
||||
- node_modules
|
||||
|
||||
stages:
|
||||
- build
|
||||
- test
|
||||
- deploy
|
||||
|
||||
build_job:
|
||||
stage: build
|
||||
|
@ -26,3 +25,14 @@ test_job:
|
|||
stage: test
|
||||
script:
|
||||
- docker run --rm -v $(pwd)/package.json:/usr/src/app/package.json -v $(pwd)/public:/usr/src/app/public -v $(pwd)/src:/usr/src/app/src -w /usr/src/app node:7.9.0-slim bash -c 'npm install; npm test'
|
||||
|
||||
deploy_review:
|
||||
stage: deploy
|
||||
environment: review
|
||||
script:
|
||||
- echo $DEPLOYMENT_CACERT > ~/.docker/ca.pem
|
||||
- echo $DEPLOYMENT_CLIENT_CERT > ~/.docker/cert.pem
|
||||
- echo $DEPLOYMENT_CLIENT_KEY > ~/.docker/key.pem
|
||||
- docker-compose build
|
||||
- docker-compose -d --tlsverify -H=$DEPLOYMENT_HOST down
|
||||
- docker-compose -d --tlsverify -H=$DEPLOYMENT_HOST up
|
4
.gitmodules
vendored
Normal file
4
.gitmodules
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
[submodule "VILLASweb-backend"]
|
||||
path = VILLASweb-backend
|
||||
url = VILLASframework/VILLASweb-backend.git
|
||||
branch = docker-names
|
|
@ -2,10 +2,9 @@ version: "2"
|
|||
|
||||
services:
|
||||
frontend:
|
||||
image: nginx:stable
|
||||
volumes:
|
||||
- ./nginx:/etc/nginx/conf.d/
|
||||
- ./build:/www
|
||||
build:
|
||||
context: .
|
||||
dockerfile: nginx/Dockerfile
|
||||
links:
|
||||
- backend
|
||||
ports:
|
||||
|
@ -13,12 +12,16 @@ services:
|
|||
- "443:443"
|
||||
|
||||
backend:
|
||||
image: villasweb-backend
|
||||
build: VILLASweb-backend
|
||||
links:
|
||||
- database
|
||||
ports:
|
||||
- "4000:4000"
|
||||
|
||||
database:
|
||||
image: mongo:latest
|
||||
volumes:
|
||||
- /opt/database:/data/db
|
||||
ports:
|
||||
- "27017:27017"
|
||||
|
||||
|
|
10
nginx/Dockerfile
Normal file
10
nginx/Dockerfile
Normal file
|
@ -0,0 +1,10 @@
|
|||
FROM nginx:stable
|
||||
|
||||
# Copy frontend files and make them accesible to nginx
|
||||
RUN mkdir /www
|
||||
COPY ./build /www
|
||||
RUN chown nginx:nginx -R /www
|
||||
RUN chmod -R 0755 /www
|
||||
|
||||
# Copy nginx configuration
|
||||
COPY ./nginx/villas.conf /etc/nginx/conf.d/default.conf
|
Loading…
Add table
Reference in a new issue