diff --git a/app/Dockerfile b/app/Dockerfile new file mode 100644 index 0000000..9684efd --- /dev/null +++ b/app/Dockerfile @@ -0,0 +1,7 @@ +FROM mhart/alpine-node:8.11.4 +WORKDIR /app +COPY package*.json /app/ +RUN npm install +COPY . /app/ +EXPOSE 3000 +CMD ["npm", "start"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..20946bc --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,40 @@ +version: "1" +services: + api: + image: webapp-api + restart: always + ports: + - "9000:9000" + volumes: + - ./api:/api + - /api/node_modules + depends_on: + - mongodb + networks: + - webappnetwork + client: + image: webapp-client + restart: always + ports: + - "3000:3000" + volumes: + - ./client:/client + - /client/node_modules + links: + - api + networks: + - webappnetwork + mongodb: + image: mongo + restart: always + container_name: mongodb + volumes: + - ./data-node:/data/db + ports: + - 27017:27017 + command: mongod --noauth --smallfiles + networks: + - webappnetwork + networks: + webappnetwork: + driver: bridge diff --git a/server/Dockerfile b/server/Dockerfile new file mode 100644 index 0000000..39c5f6c --- /dev/null +++ b/server/Dockerfile @@ -0,0 +1,7 @@ +FROM mhart/alpine-node:8.11.4 +WORKDIR /api +COPY package*.json /api/ +RUN npm install +COPY . /api/ +EXPOSE 3030 +CMD ["npm", "start-server"]