Skip to content

Commit f5cc2bc

Browse files
committed
Create setup files
1 parent b64a990 commit f5cc2bc

File tree

6 files changed

+1863
-0
lines changed

6 files changed

+1863
-0
lines changed

question-service/.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Dockerfile
2+
.dockerignore
3+
node_modules
4+
npm-debug.log
5+
dist

question-service/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/node_modules
2+
.env.dev
3+
/dist

question-service/Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM node:18.16.0-alpine as base
2+
3+
# Copy package.json and package-lock.json
4+
COPY package*.json ./
5+
6+
# Install any dependencies
7+
RUN npm install
8+
9+
# Bundle app source inside the Docker image
10+
COPY src ./src
11+
12+
COPY tsconfig.json ./tsconfig.json
13+
14+
RUN npm run build
15+
16+
# Make port 3001 available to the world outside this container
17+
ENV PORT=4001
18+
19+
EXPOSE ${PORT}
20+
21+
# Define the command to run your app
22+
CMD ["npm", "start"]

question-service/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Question Service
2+
3+
## Setup
4+
5+
Run the following command to install the dependencies
6+
7+
```bash
8+
docker build -t question-service . --no-cache
9+
docker run -p 4001:4001 --env-file .env.dev question-service
10+
```
11+
12+
## Routes Endpoint
13+
14+
- GET /questions/ - get all questions
15+
- GET /userQuestions/ - get all questions of a user

0 commit comments

Comments
 (0)