diff --git a/docker/app1-hello/node/.dockerignore b/docker/app1-hello/node/.dockerignore new file mode 100644 index 0000000..1493199 --- /dev/null +++ b/docker/app1-hello/node/.dockerignore @@ -0,0 +1,7 @@ +node_modules +npm-debug.log +.git +.gitignore +README.md +.env +.DS_Store diff --git a/docker/app1-hello/node/Dockerfile b/docker/app1-hello/node/Dockerfile new file mode 100644 index 0000000..d43a409 --- /dev/null +++ b/docker/app1-hello/node/Dockerfile @@ -0,0 +1,13 @@ +FROM node:24-alpine + +WORKDIR /app + +COPY package*.json ./ + +RUN npm install --production + +COPY . . + +EXPOSE 3000 + +CMD ["node", "app.js"] diff --git a/docker/app1-hello/python/Dockerfile b/docker/app1-hello/python/Dockerfile new file mode 100644 index 0000000..b21f79e --- /dev/null +++ b/docker/app1-hello/python/Dockerfile @@ -0,0 +1,7 @@ +FROM python:3.11.15-alpine3.22 +WORKDIR /app +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt +COPY . . +EXPOSE 3000 +CMD [ "python", "main.py" ] \ No newline at end of file diff --git a/docker/app2-tax-calculator/docker-compose.yml b/docker/app2-tax-calculator/docker-compose.yml new file mode 100644 index 0000000..deaef0e --- /dev/null +++ b/docker/app2-tax-calculator/docker-compose.yml @@ -0,0 +1,62 @@ +# services: +# service-a: +# build: ./node/service-a +# ports: +# - "3100:3000" +# depends_on: +# - service-b +# environment: +# - TAX_SERVICE_URL=http://service-b:4000 + +# service-b: +# build: ./node/service-b +# ports: +# - "3200:4000" + +# services: +# service-a: +# build: ./spring/service-a +# ports: +# - "3100:3000" +# depends_on: +# - service-b +# environment: +# - TAX_SERVICE_URL=http://service-b:4000 + +# service-b: +# build: ./spring/service-b +# ports: +# - "3200:4000" + +services: + service-a: + build: ./python/service-a + ports: + - "3100:3000" + depends_on: + - service-b + environment: + - TAX_SERVICE_URL=http://service-b:4000 + - FRONTEND_URL=http://localhost:5173 + networks: + - tax-network + + service-b: + build: ./python/service-b + ports: + - "3200:4000" + networks: + - tax-network + + frontend: + build: ./tax-calculator-frontend + ports: + - "5173:80" + depends_on: + - service-a + networks: + - tax-network + +networks: + tax-network: + driver: bridge diff --git a/docker/app2-tax-calculator/node/service-a/.dockerignore b/docker/app2-tax-calculator/node/service-a/.dockerignore new file mode 100644 index 0000000..1493199 --- /dev/null +++ b/docker/app2-tax-calculator/node/service-a/.dockerignore @@ -0,0 +1,7 @@ +node_modules +npm-debug.log +.git +.gitignore +README.md +.env +.DS_Store diff --git a/docker/app2-tax-calculator/node/service-a/Dockerfile b/docker/app2-tax-calculator/node/service-a/Dockerfile new file mode 100644 index 0000000..4e6aa44 --- /dev/null +++ b/docker/app2-tax-calculator/node/service-a/Dockerfile @@ -0,0 +1,13 @@ +FROM node:24-alpine + +WORKDIR /app + +COPY package*.json ./ + +RUN npm install --production + +COPY . . + +EXPOSE 3000 + +CMD ["node", "index.js"] diff --git a/docker/app2-tax-calculator/node/service-b/.dockerignore b/docker/app2-tax-calculator/node/service-b/.dockerignore new file mode 100644 index 0000000..1493199 --- /dev/null +++ b/docker/app2-tax-calculator/node/service-b/.dockerignore @@ -0,0 +1,7 @@ +node_modules +npm-debug.log +.git +.gitignore +README.md +.env +.DS_Store diff --git a/docker/app2-tax-calculator/node/service-b/Dockerfile b/docker/app2-tax-calculator/node/service-b/Dockerfile new file mode 100644 index 0000000..2b5eec8 --- /dev/null +++ b/docker/app2-tax-calculator/node/service-b/Dockerfile @@ -0,0 +1,13 @@ +FROM node:24-alpine + +WORKDIR /app + +COPY package*.json ./ + +RUN npm install --production + +COPY . . + +EXPOSE 4000 + +CMD ["node", "index.js"] diff --git a/docker/app2-tax-calculator/python/service-a/Dockerfile b/docker/app2-tax-calculator/python/service-a/Dockerfile new file mode 100644 index 0000000..b21f79e --- /dev/null +++ b/docker/app2-tax-calculator/python/service-a/Dockerfile @@ -0,0 +1,7 @@ +FROM python:3.11.15-alpine3.22 +WORKDIR /app +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt +COPY . . +EXPOSE 3000 +CMD [ "python", "main.py" ] \ No newline at end of file diff --git a/docker/app2-tax-calculator/python/service-b/Dockerfile b/docker/app2-tax-calculator/python/service-b/Dockerfile new file mode 100644 index 0000000..8f0a216 --- /dev/null +++ b/docker/app2-tax-calculator/python/service-b/Dockerfile @@ -0,0 +1,7 @@ +FROM python:3.11.15-alpine3.22 +WORKDIR /app +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt +COPY . . +EXPOSE 4000 +CMD [ "python", "main.py" ] \ No newline at end of file diff --git a/docker/app2-tax-calculator/spring/service-a/Dockerfile b/docker/app2-tax-calculator/spring/service-a/Dockerfile new file mode 100644 index 0000000..473a602 --- /dev/null +++ b/docker/app2-tax-calculator/spring/service-a/Dockerfile @@ -0,0 +1,5 @@ +FROM eclipse-temurin:21-jdk +WORKDIR /app +COPY target/*.jar app.jar +EXPOSE 3000 +CMD [ "java", "-jar", "app.jar", "--server.port=3000" ] \ No newline at end of file diff --git a/docker/app2-tax-calculator/spring/service-b/Dockerfile b/docker/app2-tax-calculator/spring/service-b/Dockerfile new file mode 100644 index 0000000..f678d6f --- /dev/null +++ b/docker/app2-tax-calculator/spring/service-b/Dockerfile @@ -0,0 +1,5 @@ +FROM eclipse-temurin:21-jdk +WORKDIR /app +COPY target/*.jar app.jar +EXPOSE 4000 +CMD [ "java", "-jar", "app.jar", "--server.port=4000" ] \ No newline at end of file diff --git a/docker/app2-tax-calculator/tax-calculator-frontend/Dockerfile b/docker/app2-tax-calculator/tax-calculator-frontend/Dockerfile new file mode 100644 index 0000000..c544e95 --- /dev/null +++ b/docker/app2-tax-calculator/tax-calculator-frontend/Dockerfile @@ -0,0 +1,11 @@ +FROM node:24-slim AS build +WORKDIR /app +COPY package*.json ./ +RUN npm install +COPY . . +RUN npm run build + +FROM nginx:alpine +COPY --from=build /app/dist /usr/share/nginx/html +EXPOSE 80 +