Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed core/Dockerfile
Empty file.
67 changes: 67 additions & 0 deletions core/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
FROM zouzias/boost:1.67.0

RUN apt-get -y update \
&& apt-get -y upgrade

RUN apt-get install -y \
openssh-server \
g++ \
cmake \
git

#installing the mongoc dependencies and driver
RUN apt-get install -y \
pkg-config \
libssl-dev \
libsasl2-dev
RUN cd ~ \
&& wget https://github.com/mongodb/mongo-c-driver/releases/download/1.7.0/mongo-c-driver-1.7.0.tar.gz \
&& tar xzf mongo-c-driver-1.7.0.tar.gz \
&& cd mongo-c-driver-1.7.0 \
&& ./configure --disable-automatic-init-and-cleanup \
&& make \
&& make install \
&& cd ~ \
&& rm mongo-c-driver-1.7.0.tar.gz \
&& rm -rf mongo-c-driver-1.4.2

#installing mongocxx driver - connects c++ to mongo
RUN cd ~ \
&& wget https://github.com/mongodb/mongo-cxx-driver/archive/r3.1.4.tar.gz \
&& tar -xzf r3.1.4.tar.gz \
&& cd mongo-cxx-driver-r3.1.4/build \
&& cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local .. \
&& make EP_mnmlstc_core \
&& make \
&& make install \
&& cd ~ \
&& rm r3.1.4.tar.gz \
&& rm -rf mongo-cxx-driver-r3.1.4

# install additional boost
RUN cd /usr/include/boost \
&& ./bootstrap.sh \
&& ./bjam install --with-filesystem --with-thread --with-system --with-date_time --with-random link=static runtime-link=shared threading=multi

# install protobuf
RUN cd ~ \
&& apt-get install -y autoconf automake libtool curl make g++ unzip \
&& wget https://github.com/protocolbuffers/protobuf/releases/download/v3.6.1/protobuf-cpp-3.6.1.tar.gz \
&& tar zxvf protobuf-cpp-3.6.1.tar.gz \
&& cd protobuf-3.6.1 \
&& ./autogen.sh \
&& ./configure \
&& make \
&& make check \
&& make install \
&& ldconfig

# Copy files inside workdir
WORKDIR /server

COPY . /server

RUN rm /server/CMakeCache.txt

# Build and run server
CMD ./docker_entry.sh
4 changes: 4 additions & 0 deletions core/server/docker_entry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

# Launching the server
cmake . && make && ./core
41 changes: 41 additions & 0 deletions docker-compose-no-backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
version: '3'
services:
db:
image: mongo:latest
expose:
- "27017"
ports:
- 27017:27017
networks:
- pds-network
reader:
restart: always
container_name: reader
build:
context: ./frontend/reader
dockerfile: Dockerfile
depends_on:
- db
expose:
- "8000"
ports:
- 8000:8000
networks:
- pds-network
gui:
restart: always
container_name: gui
build:
context: ./frontend/paper
dockerfile: Dockerfile
depends_on:
- reader
ports:
- 80:4200
volumes:
- .:/app
networks:
- pds-network
networks:
pds-network:
driver: bridge
25 changes: 20 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
version: '3'
services:
db:
build:
context: .
dockerfile: mongo.dockerfile
image: mongo:latest
expose:
- "27017"
ports:
Expand All @@ -21,6 +19,8 @@ services:
- db
expose:
- "8000"
ports:
- 8000:8000
networks:
- pds-network
gui:
Expand All @@ -32,10 +32,25 @@ services:
depends_on:
- reader
ports:
- 4200:80
- 80:4200
volumes:
- .:/app
networks:
- pds-network
backend:
restart: always
container_name: backend
build:
context: ./core/server
dockerfile: Dockerfile
depends_on:
- db
expose:
- "12345"
ports:
- 12345:12345
networks:
- pds-network

networks:
pds-network:
driver: bridge
3 changes: 0 additions & 3 deletions frontend/paper/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,5 @@ COPY package.json /app/package.json
RUN npm install
RUN npm install -g @angular/cli@7.3.9

# add app
COPY . /app

# start app
CMD ng serve --host 0.0.0.0
1 change: 0 additions & 1 deletion mongo.dockerfile

This file was deleted.