diff --git a/apps/crud/Dockerfile b/apps/crud/Dockerfile new file mode 100644 index 0000000..3cf34ab --- /dev/null +++ b/apps/crud/Dockerfile @@ -0,0 +1,23 @@ +# Use an official Node.js runtime as the base image +FROM node:14 + +# Set the working directory in the container +WORKDIR /app + +# Copy the package.json and package-lock.json files to the container +COPY package.json /app/ + +# Install application dependencies +RUN npm install + +# Copy the entire monorepo project into the container +COPY . /app/ + +# Build the React.js application inside the 'crud' app directory +RUN npx nx build crud + +# Expose the application port (change to the actual port your app uses) +EXPOSE 3000 + +# Start the application inside the 'crud' app directory +CMD [ "npx", "nx", "serve", "crud" ] diff --git a/apps/crud/proxy.conf.json b/apps/crud/proxy.conf.json index c7d3a2b..47a91af 100644 --- a/apps/crud/proxy.conf.json +++ b/apps/crud/proxy.conf.json @@ -2,5 +2,9 @@ "/api": { "target": "http://localhost:8000", "secure": false - } + }, + "/api/docs": { + "target": "http://localhost:8000/docs", + "secure": false + } } diff --git a/apps/docker-compose.yaml b/apps/docker-compose.yaml index 6afd05a..68a9106 100644 --- a/apps/docker-compose.yaml +++ b/apps/docker-compose.yaml @@ -8,6 +8,9 @@ services: - .env ports: - "5430:5432" + networks: + - app + http_server: build: ./py-conveyor-service/ restart: on-failure @@ -19,3 +22,22 @@ services: - db volumes: - ./py-conveyor-service/:/app + networks: + - app + + frontend: + build: ./crud/ + restart: always + env_file: + - .env + ports: + - "4200:4200" + depends_on: + - http_server + networks: + - app + +networks: + app: + driver: bridge +