Skip to content

Commit

Permalink
Feature/divide sgx dockerfile (#48)
Browse files Browse the repository at this point in the history
* created separate dockerfile for sgx

* created separate dockerfile for sgx

* adjust comment

* update node to 10.16
  • Loading branch information
kss-espeo authored Jul 26, 2019
1 parent 8b69119 commit e5fc2b7
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 19 deletions.
17 changes: 1 addition & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
FROM sebvaucher/sgx-base:sgx_2.5

# Add SGX SDK libs to source. It does what 'source /opt/intel/sgxsdk/environment' does
ENV SGX_SDK /opt/intel/sgxsdk
ENV PATH=$SGX_SDK/bin:$SGX_SDK/bin/x64:$PATH \
PKG_CONFIG_PATH=$SGX_SDK/pkgconfig:$PKG_CONFIG_PATH \
LD_LIBRARY_PATH=$SGX_SDK/sdk_libs:./libs:$LD_LIBRARY_PATH

# Install nodejs dependencies
RUN apt-get update -q -q && \
apt-get install curl libssl1.0-dev --yes

# Install nodejs v11
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install -y nodejs
RUN npm install npm --global
FROM node:10.16

# Create app directory
WORKDIR /usr/src/app
Expand Down
31 changes: 31 additions & 0 deletions Dockerfile.sgx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM sebvaucher/sgx-base:sgx_2.5

# Add SGX SDK libs to source. It does what 'source /opt/intel/sgxsdk/environment' does
ENV SGX_SDK /opt/intel/sgxsdk
ENV PATH=$SGX_SDK/bin:$SGX_SDK/bin/x64:$PATH \
PKG_CONFIG_PATH=$SGX_SDK/pkgconfig:$PKG_CONFIG_PATH \
LD_LIBRARY_PATH=$SGX_SDK/sdk_libs:./libs:$LD_LIBRARY_PATH

# Install nodejs dependencies
RUN apt-get update -q -q && \
apt-get install curl libssl1.0-dev --yes

# Install nodejs v10
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install -y nodejs
RUN npm install npm --global

# Create app directory
WORKDIR /usr/src/app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./

RUN npm install

# Bundle app source
COPY . .

CMD [ "npm", "start" ]
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ clean-local:

ganache:
docker-compose -f docker-compose.yml -f docker-compose.local.yml up -d --build ganache-cli

sgx: copy-env
docker-compose -f docker-compose.sgx.yml -f docker-compose.local.yml up -d --build
29 changes: 29 additions & 0 deletions docker-compose.sgx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: '3'
services:
app:
container_name: oracle-server
build:
context: ""
dockerfile: Dockerfile.sgx
env_file:
- .env
depends_on:
- mongo
ports:
- ${API_PORT}:${API_PORT}
devices:
- /dev/isgx
- /dev/mei0
command: bash -c "./wait-for-it.sh mongo:27017 && npm start"
mongo:
container_name: oracle-db
image: mongo:4.1.13
ports:
- 27017:27017
- 27018:27018
mongo-test:
container_name: test-db
image: mongo:4.1.13
ports:
- 37017:27017
- 37018:27018
3 changes: 0 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ services:
- mongo
ports:
- ${API_PORT}:${API_PORT}
devices:
- /dev/isgx
- /dev/mei0
command: bash -c "./wait-for-it.sh mongo:27017 && npm start"
mongo:
container_name: oracle-db
Expand Down

0 comments on commit e5fc2b7

Please sign in to comment.