-
-
Notifications
You must be signed in to change notification settings - Fork 807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Devcontainer #2429
base: develop
Are you sure you want to change the base?
Devcontainer #2429
Changes from 50 commits
fb46cd9
5e5b3ba
94483db
0d85405
3453a01
63db829
5af03b9
30a60c3
37ebcd9
294c279
ea8bbfd
c1efe35
0711a90
cd64b9b
978aa6e
af49f26
3e62b40
c2f0029
a0d736d
a35e64f
2e82058
56a7770
ffb745a
9a9f2c6
72ce9a1
b0a99c8
4765b00
6a7f6d4
6600ce2
63dcde3
034a06b
a69ed74
f84ec55
64d8f7d
682fdff
ac0ebee
91b90fc
6faf0c7
7023c8d
6723695
48d2845
413dc84
6c08aa4
36b1820
a4872ac
8709207
bf8b54b
fd7b6f7
b283c70
2f0bf4c
a412dd4
6cc696a
b868a11
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Use Debian Bookworm as the base image | ||
FROM debian:bookworm as builder | ||
|
||
# Update package list and install dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
git \ | ||
vim \ | ||
curl \ | ||
gnupg2 \ | ||
lsb-release \ | ||
ca-certificates | ||
|
||
# Install Node.js (latest LTS version) and npm | ||
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ | ||
apt-get install -y nodejs | ||
|
||
# Install additional developer tools (optional) | ||
RUN apt-get install -y \ | ||
neovim \ | ||
gh # GitHub CLI | ||
|
||
# Default command (to keep the container running) | ||
CMD ["tail", "-f", "/dev/null"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"name": "talawa api dev environment", | ||
"dockerComposeFile": "docker-compose.yaml", | ||
"service": "devcontainer", | ||
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", | ||
// Settings to apply to the workspace. | ||
"customizations": { | ||
// Configure properties specific to VS Code. | ||
"vscode": { | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/bash", | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"database.host": "mongodb", | ||
"redis.host": "redis-stack-server" | ||
}, | ||
// List of extensions to install inside the container | ||
"extensions": [ | ||
"dbaeumer.vscode-eslint", | ||
"ms-azuretools.vscode-docker", | ||
"esbenp.prettier-vscode", | ||
"redhat.vscode-yaml" | ||
] | ||
} | ||
}, | ||
// Set up forward ports | ||
"forwardPorts": [ | ||
4000, // Server port | ||
27017, // MongoDB port | ||
6379 // Redis port | ||
], | ||
// Post-create commands to run after creating the container | ||
"postCreateCommand": "npm install", | ||
|
||
// Volumes from docker-compose are already included | ||
"shutdownAction": "stopCompose" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
services: | ||
mongodb: | ||
image: mongo:latest | ||
ports: | ||
- 27017:27017 | ||
volumes: | ||
- mongodb-data:/data/db | ||
Comment on lines
+2
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Specify a version for the MongoDB image. Using the image: mongo:6.0 |
||
|
||
redis-stack-server: | ||
image: redis/redis-stack-server:latest | ||
ports: | ||
- 6379:6379 | ||
volumes: | ||
- redis-data:/data | ||
Comment on lines
+9
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Specify a version for the Redis Stack Server image. Using the image: redis/redis-stack-server:6.2.6 |
||
|
||
devcontainer: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
ports: | ||
- "${SERVER_PORT:-4000}:4000" | ||
volumes: | ||
- ../..:/workspaces:cached | ||
depends_on: | ||
- mongodb | ||
- redis-stack-server | ||
environment: | ||
- MONGO_DB_URL=mongodb://mongodb:27017 | ||
- REDIS_HOST=redis-stack-server | ||
- REDIS_PORT=6379 | ||
|
||
volumes: | ||
mongodb-data: | ||
redis-data: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,4 @@ COPY . . | |
|
||
EXPOSE 4000 | ||
|
||
CMD ["npm", "run", "dev"] | ||
CMD ["npm", "run", "dev"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ This document provides instructions on how to set up and start a running instanc | |
- [Install node.js](#install-nodejs) | ||
- [Install TypeScript](#install-typescript) | ||
- [Install Required Packages](#install-required-packages) | ||
- [Installation Using Devpod](#install-using-devpod) | ||
AVtheking marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- [Installation Using Docker](#installation-using-docker) | ||
- [Run the Talawa-API Setup](#run-the-talawa-api-setup) | ||
- [Install the Docker Application](#install-the-docker-application) | ||
|
@@ -288,6 +289,17 @@ We have created a setup script to make configuring Talawa-API easier. | |
``` | ||
npm run setup | ||
``` | ||
## Install Using Devpod | ||
This guide provides a step-by-step guide to setting up a Talawa-Api server using Devpod. | ||
|
||
Follow these steps: | ||
|
||
1. Install the Devpod GUI application or Devpod CLI. [Learn more](https://devpod.sh/docs/getting-started/install) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this method independent of installing node.js and typescript as prerequisites? If it is, then it should be its own section. Think of the end user, not everyone is familiar with this technology. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes it is independent of installing node. js and ts , I didn't get with the point it should be its own section , could you clearify it more ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
2. Add a provider to Devpod. For CLI, see [here](https://devpod.sh/docs/getting-started/quickstart-devpod-cli#add-a-provider) and for the GUI app, see [here](https://devpod.sh/docs/getting-started/quickstart-vscode#add-a-provider). Use Docker which you can install from their [official documentation](https://docs.docker.com/engine/install/) or docker compatible provider like podman, colima(better compatibility with macos). | ||
AVtheking marked this conversation as resolved.
Show resolved
Hide resolved
|
||
3. Run the following command: ```devpod up https://github.com/PalisadoesFoundation/talawa-api@develop```, or follow the instructions for CLI [here](https://devpod.sh/docs/developing-in-workspaces/create-a-workspace#git-repository) and for the GUI app [here](https://devpod.sh/docs/getting-started/quickstart-vscode#start-a-workspace-with-vs-code). | ||
AVtheking marked this conversation as resolved.
Show resolved
Hide resolved
|
||
4. Select your desired IDE. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the user isn't a developer then they won't have an IDE. How will this help? Is there a solution to non-technical users to get the app functional? More work needs to be done on the instructions. I need to be able to follow the instructions without having to know insider steps There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can have the api running without using ide , but for that it require little bit of change, I did just not spin up the api server using this is for developer as they may want to customize it according to their need. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It needs to be clearer. You are assuming the only user will be a developer. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would suggest first let us test it for developers, then we can move to the users ease. |
||
5. After completing the above steps, the Talawa API server will be set up in your chosen IDE. | ||
6. Once the IDE is open, run ```npm run setup``` to set up the environment file, or start your server by running ```npm run dev```. | ||
|
||
## Install the Docker Application | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't you utilize the already existing
docker-compose.dev.yaml
file?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I was using the compose file outside the .decontainer.json file it was having some issues related to the project directory, that's why I used the file inside it. If I move the already existing file to that folder, developers can have issues, if they use docker for db.