This code is property of caselaws.org. Unauthorised use and reproduction of code would lead to prosecution. Please contact the owner before using code.
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.
Pull them and use the following yml file to deploy using docker-compose
version: '3.7'
services:
caselaws-prod:
container_name: caselaws-prod
build:
context: .
dockerfile: Dockerfile
ports:
- '5000:80'
# 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;"]
version: '3.7'
services:
caselaws-webservice:
image: karam/caselaws:webservice
ports:
- "8080:8080"
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"]
docker-compose -f docker-compose.yml up -d --build
Content type
Image
Digest
Size
272.6 MB
Last updated
about 6 years ago
docker pull karam/caselaws:webservice