MS Teams Bot app with a Tab app – Can I use docker compose to put them into separate containers for dev deployment?

I have an MS app that contains both a Bot app and Tab app. I need to use docker as part of our CI/CD process to deploy the app to our Development environment on AWS.

So far I have been trying to have both apps run in a single docker container, but it seems to be a conflict between ReactJS (Tab app) and NodeJS (Bot app).

As when I get the bot app to run, I can’t get the react app to run – and visa versa.

Dockerfile which works to get Bot to run:

FROM node:18.18.0 as development
ENV PORT=80
EXPOSE 80
WORKDIR /usr/src/app

ENV NODE_ENV=development
COPY ["package*.json", "./"]
COPY ["./bot", "./"]
COPY ["./tab", "./"]

RUN npm install

COPY . .
RUN chown -R node /usr/src/app
USER node
CMD ["npm", "run", "dev:bot"]

FROM development as build
RUN npm run build:bot


FROM node:18.18.0-alpine as production
ENV PORT=80 
EXPOSE 80
WORKDIR /usr/src/app

ENV NODE_ENV=production
COPY --from=build /usr/src/app/node_modules ./node_modules
COPY --from=build /usr/src/app/package.json ./package.json
COPY --from=build /usr/src/app/bot/lib ./bot/lib
COPY --from=build /usr/src/app/bot/node_modules ./bot/lib/node_modules
COPY --from=build /usr/src/app/bot/package.json ./bot/lib/package.json
COPY --from=build /usr/src/app/tab/build ./tab/build
COPY --from=build /usr/src/app/tab/node_modules ./tab/node_modules
COPY --from=build /usr/src/app/tab/build /usr/share/nginx/html
CMD ["node", "./bot/lib/index.js"]

Bot is accessible, but ReactJS app doesn’t load/work.

I then try to load the ReactJS app using Nginx, but then the bot is not running:

# Use the official Node.js image as the base image for building
FROM node:18.18.0 as development

# Set the working directory in the container
WORKDIR /usr/src/app
ENV NODE_ENV=development

# Copy package.json and package-lock.json to the working directory
COPY package*.json ./

# Copy Tab app (ReactJS) to the working directory
COPY ["./tab", "./"]

# Copy Bot app (NodeJS) to the working directory
COPY ["./bot", "./"]

# Install dependencies for both backend and frontend
RUN npm install

# Copy the rest of the backend and frontend application code
COPY . .
RUN chown -R node /usr/src/app
USER node
CMD ["npm", "run", "dev:bot"]

# Build the React app and Bot App
FROM development as build
RUN npm run build

# FROM node:18.18.0-alpine as production
# ENV PORT=80 
# EXPOSE 80
# WORKDIR /usr/src/app

ENV NODE_ENV=production

# Use Nginx as a base image to serve the static files
FROM nginx:alpine as production
ENV NODE_ENV=production

# Copy the bot build output from the build stage to working directorys' bot folder
COPY --from=build /usr/src/app/node_modules ./node_modules
COPY --from=build /usr/src/app/package.json ./package.json
COPY --from=build /usr/src/app/bot/lib ./bot/lib
COPY --from=build /usr/src/app/bot/node_modules ./bot/lib/node_modules
COPY --from=build /usr/src/app/bot/package.json ./bot/lib/package.json

# Remove default nginx website
RUN rm -rf /usr/share/nginx/html/*

# Copy the build output from the build stage to the Nginx public directory
COPY --from=build /usr/src/app/tab/build /usr/share/nginx/html

# Copy nginx configuration file
COPY nginx.conf /etc/nginx/nginx.conf

# Expose port 80 to the outside world
EXPOSE 80

# Command to run Nginx
CMD ["nginx", "-g", "daemon off;"]

So my question is – is it possible to use docker compose and have each app running in it’s own container rather?

And then if so, how would I configure the MS app to use bot and tab specific URLs?

New contributor

Robert Stevens is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật