Sign inSign up

karam/caselaws

By karam

•Updated about 6 years ago

Caselaws.org

Image
0

93

karam/caselaws repository overview

⁠Information

This code is property of caselaws.org. Unauthorised use and reproduction of code would lead to prosecution. Please contact the owner before using code.

⁠Prerequesite

Clone the frontend (react) code from git to directory called frontend and project webservice in directory called webservice. Once you have cloned both, make the Dockerfile and docker-compose file in frontend directory as well as in webservice directory. Once done, build the image to local first, then using the yml file, deploy both webservice and the frontend.

⁠The image has two tags :

⁠1. frontend

⁠2. webservice

Pull them and use the following yml file to deploy using docker-compose

⁠frontend yml (this uses underlying dockerfile)

version: '3.7'
services:
  caselaws-prod:
    container_name: caselaws-prod
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - '5000:80'

⁠content of Dockerfile

# pull official base image
FROM node:14.3.0 as build
# set working directory
WORKDIR /app
# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH
# install app dependencies
COPY package.json ./
COPY package-lock.json ./
RUN npm ci --silent
RUN npm install [email protected] -g --silent
# add app
COPY . ./
# start app
RUN npm run build
# production environment
FROM nginx:stable-alpine
COPY --from=build /app/build /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

⁠2. Webservice Yml

version: '3.7'

services:
  caselaws-webservice:
    image: karam/caselaws:webservice
    ports:
      - "8080:8080"

⁠webservice java dockerfile

FROM openjdk:8-jdk
RUN mkdir -p /opt
RUN mkdir -p /opt/webservice
COPY ./webservice.properties /opt/webservice/
COPY ./webservice-0.0.1-SNAPSHOT.jar /app/webservice-0.0.1-SNAPSHOT.jar
EXPOSE 8080
CMD ["java", "-jar", "/app/webservice-0.0.1-SNAPSHOT.jar"]

⁠3. Run the following command to deploy on swarm :

docker-compose -f docker-compose.yml up -d --build

Tag summary

Content type

Image

Digest

Size

272.6 MB

Last updated

about 6 years ago

docker pull karam/caselaws:webservice