Skip to content

Commit

Permalink
Merge pull request #1 from Wings30306/daytona-switch
Browse files Browse the repository at this point in the history
Daytona switch
  • Loading branch information
NielMc authored May 23, 2024
2 parents 271ff95 + 5b511ef commit f2cb2db
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 25 deletions.
8 changes: 4 additions & 4 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:20.04

ENV PYTHON_VERSION 3.8.11
ENV PYTHON_VERSION 3.9.18
ENV DEBIAN_FRONTEND=noninteractive
#Install pyenv and mongo shell dependencies
RUN apt-get update && apt-get install -y gnupg2
Expand All @@ -11,7 +11,7 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691eec35216c6

RUN curl https://cli-assets.heroku.com/install.sh | sh

ARG USERNAME=codeany
ARG USERNAME=cistudent
RUN useradd -ms /bin/bash $USERNAME
USER $USERNAME
WORKDIR /home/$USERNAME
Expand All @@ -32,7 +32,7 @@ RUN set -ex \

RUN echo 'alias python=python3' >> ~/.bashrc && \
echo 'export PIP_USER=yes' >> ~/.bashrc && \
echo 'alias pip=pip3' >> ~/.bashrc \
echo 'alias pip=pip3' >> ~/.bashrc && \
echo 'alias mongosh=mongo' >> ~/.bashrc

COPY ./build-assets/heroku_config.sh /home/$USERNAME/.theia/heroku_config.sh
Expand All @@ -44,4 +44,4 @@ RUN echo 'alias make_url="python3 $HOME/.theia/make_url.py "' >> ~/.bashrc
USER root
RUN chown -R $USERNAME:$USERNAME /home/$USERNAME/.theia

CMD ["tail", "-f", "/dev/null"]
CMD ["tail", "-f", "/dev/null"]
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@
"**/core.python*": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": false,
"python.linting.pycodestyleEnabled": true,
"python.terminal.activateEnvironment": false,
"workbench.iconTheme": "none"
}
}
},

"remoteUser": "codeany"
"remoteUser": "cistudent"
}
8 changes: 3 additions & 5 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
version: '3'
services:
app:
build:
context: .
dockerfile: Dockerfile
image: public.ecr.aws/m5f1e7g7/ci-project-templates-mongo:version1.0

mongo:
image: mongo:latest
environment:
MONGO_INITDB_ROOT_USERNAME: codeany
MONGO_INITDB_ROOT_USERNAME: cistudent
MONGO_INITDB_ROOT_PASSWORD: pass1234
network_mode: service:app
network_mode: service:app
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
![CI logo](https://codeinstitute.s3.amazonaws.com/fullstack/ci_logo_small.png)
# ![CI logo](https://codeinstitute.s3.amazonaws.com/fullstack/ci_logo_small.png)

Welcome,

This is the Code Institute student template for the mongo lessons. We have preinstalled all of the tools you need to get started. It's perfectly ok to use this template as the basis for your project submissions.
This is the Code Institute student template for using Mongo. We have preinstalled all of the tools you need to get started. It's perfectly ok to use this template as the basis for your project submissions.

You can safely delete this README.md file, or change it for your own project. Please do read it at least once, though! It contains some important information about Codeanywhere and the extensions we use. Some of this information has been updated since the video content was created. The last update to this file was: **April 3rd, 2023**
You can safely delete this README.md file, or change it for your own project. Please do read it at least once, though! It contains some important information about this template and the extensions we use. Some of this information has been updated since the video content was created. The last update to this file was: **November 13th, 2023**

## Codeanywhere Reminders
## IDE Reminders

# IDE
### Connecting your database

- **Connect to Mongo CLI on a IDE**
- navigate to your MongoDB Clusters Sandbox
Expand All @@ -19,7 +19,9 @@ You can safely delete this README.md file, or change it for your own project. Pl
- choose option: **"Run your connection string in your command line"**
- `mongo "mongodb+srv://<CLUSTER-NAME>.mongodb.net/<DBname>" --username <USERNAME>`
- replace all `<angle-bracket>` keys with your own data
- enter password *(will not echo **\*\*\*\*** *on screen)\*
- enter password _(will not echo **\*\*\*\*** on screen)_

### Other commands

#### Clear screen in Mongo Shell:

Expand All @@ -29,24 +31,20 @@ You can safely delete this README.md file, or change it for your own project. Pl

- `show collections`

To run a frontend (HTML, CSS, Javascript only) application in Codeanywhere, in the terminal, type:

`python3 -m http.server`

A button should appear to click: _Open Preview_ or _Open Browser_.
#### Run your project

To run a backend Python file, type `python3 app.py`, if your Python file is named `app.py` of course.
As we need to run a backend Python file, we should use the command `python3 app.py`, if your Python file is named `app.py` of course.

A button should appear to click: _Open Preview_ or _Open Browser_.

In Codeanywhere you have superuser security privileges by default. Therefore you do not need to use the `sudo` (superuser do) command in the bash terminal in any of the lessons.
In most cloudbased IDEs you have superuser security privileges by default. Therefore you do not need to use the `sudo` (superuser do) command in the bash terminal in any of the lessons.

To log into the Heroku toolbelt CLI:
### To log into the Heroku toolbelt CLI:

1. Log in to your Heroku account and go to _Account Settings_ in the menu under your avatar.
2. Scroll down to the _API Key_ and click _Reveal_
3. Copy the key
4. In Codeanywhere, from the terminal, run `heroku_config`
4. In your IDE, from the terminal, run `heroku_config`
5. Paste in your API key when asked

You can now use the `heroku` CLI program - try running `heroku apps` to confirm it works. This API key is unique and private to you so do not share it. If you accidentally make it public then you can create a new one with _Regenerate API Key_.
Expand Down

0 comments on commit f2cb2db

Please sign in to comment.