Skip to content
Open
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
23 changes: 7 additions & 16 deletions result/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
# Shared base
FROM node:18-slim AS base
FROM node:18-alpine

WORKDIR /app

COPY package*.json ./
COPY . .

RUN npm config set registry https://registry.npmjs.org \
&& npm install -g nodemon

RUN npm ci \
RUN npm install \
&& npm cache clean --force \
&& mv /app/node_modules /node_modules

COPY . .

ENV PORT 80
ENV PORT=80

EXPOSE 80

CMD ["node", "server.js"]

# Development
FROM base as dev

RUN npm install -g nodemon

# Production
FROM base

RUN npm install -g nodemon
14 changes: 14 additions & 0 deletions result/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
| **Sub-heading** | **Instruction / Value** |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Base Image** | node:18-alpine |
| **Work Directory** | /app |
| **Port** | 80 |
| **Launch Command** | node server.js |
| **Build Instruction** | npm config set registry [https://registry.npmjs.org](https://registry.npmjs.org)
npm install -g nodemon

npm install \
<br> && npm ls \
<br> && npm cache clean --force \
<br> && mv /app/node_modules /node_modules

19 changes: 8 additions & 11 deletions vote/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
# Using official python runtime base image
FROM python:3.11-alpine
FROM python:2.7-alpine

# Set the application directory
WORKDIR /app

# Install our requirements.txt
ADD requirements.txt /app/requirements.txt
RUN pip install -r requirements.txt
# Copy application files
COPY . .

# Copy our code from the current folder to /app inside the container
ADD . /app
# Install dependencies
RUN pip install -r requirements.txt

# Make port 80 available for links and/or publish
# Expose application port
EXPOSE 80

# Define our command to be run when launching the container
CMD ["gunicorn", "app:app", "-b", "0.0.0.0:80", "--log-file", "-", "--access-logfile", "-", "--workers", "4", "--keep-alive", "0"]
# Start the app
CMD ["gunicorn", "app:app", "-b", "0.0.0.0:80"]
8 changes: 8 additions & 0 deletions vote/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Item Description
Base python:2.7-alpine
Work Directory /app
Build Instruction pip install -r requirement.txt
port 80
launch command gunicorn app:app -b 0.0.0.0:80


22 changes: 7 additions & 15 deletions worker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
FROM maven:3.9-amazoncorretto-8 AS build

FROM joshua122/worker:v2 AS build
WORKDIR /code
COPY . .
RUN mvn package -Dskiptests

COPY pom.xml /code/pom.xml
RUN ["mvn", "dependency:resolve"]
RUN ["mvn", "verify"]

# Adding source, compile and package into a fat jar
COPY ["src/main", "/code/src/main"]
RUN ["mvn", "package"]

FROM amazoncorretto:8-alpine-jre

COPY --from=build /code/target/worker-jar-with-dependencies.jar /

CMD ["java", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseCGroupMemoryLimitForHeap", "-jar", "/worker-jar-with-dependencies.jar"]
FROM openjdk:8-jre-alpine
WORKDIR /run
COPY --from=build /code/target/worker-jar-with-dependencies.jar worker.jar
CMD ["java", "-jar", "worker.jar"]
4 changes: 4 additions & 0 deletions worker/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM maven:3.5-jdk-8-alpine AS build
WORKDIR /code
COPY pom.xml ./
RUN mvn dependency:go-offline
11 changes: 11 additions & 0 deletions worker/READme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
image build information :

| **Item** | **Description** |
| --------------------- | ---------------------------------------------- |
| **Base** | `maven:3.5-jdk-8-alpine` |
| **Work directory** | `/code` |
| **Build instruction** | `mvn package -D skiptests` |
| **Ports** | N/A |
| **Runtime image** | `openjdk:8-jre-alpine` |
| **Launch command** | `java -jar target/worker-jar-dependencies.jar` |