Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2fb367d
Merge pull request #9 from cloudyuga/revert-8-master
cloudyuga Feb 15, 2017
035eeb7
Delete csvdata.html
cloudyuga Feb 15, 2017
7d10a17
Update profile.html to fix issue 1
cloudyuga Aug 27, 2017
4b2ffd4
Update profile.html
nkhare Sep 14, 2018
53369d9
Update profile.html
nkhare Sep 14, 2018
3fcb5c9
Update docker-compose.yml
cloudyuga Sep 24, 2018
0335e0f
Create .circleci
nkhare Oct 16, 2018
83cf2fc
Delete .circleci
nkhare Oct 16, 2018
61bf44c
Create config.yml
nkhare Oct 16, 2018
93f7d41
Update config.yml
nkhare Oct 16, 2018
7b57530
Create config.yaml
nkhare Oct 16, 2018
41f206e
Rename .config/config.yaml to .circleci/config.yaml
nkhare Oct 16, 2018
3f5f718
Rename config.yaml to config.yml
nkhare Oct 16, 2018
d70f2ee
Update config.yml
nkhare Oct 16, 2018
a62fef3
Delete config.yml
nkhare Oct 16, 2018
e11cec5
Create rsvp.yaml
nkhare Oct 16, 2018
7b084c4
Update profile.html
nkhare Oct 16, 2018
01812b1
Update rsvp.yaml
nkhare Oct 16, 2018
6ed1b44
Update config.yml
nkhare Oct 16, 2018
68320e8
Update rsvp.yaml
nkhare Oct 16, 2018
0ad673a
Update config.yml
nkhare Oct 17, 2018
371a7de
Merge pull request #15 from nkhare/dev
nkhare Oct 17, 2018
0382a70
Delete config.yml
nkhare Oct 17, 2018
7cb4cd3
Delete rsvp.yaml
nkhare Oct 17, 2018
aead1a6
Update Dockerfile
cloudyuga Jun 22, 2021
5638c9c
optimized Dockerfile related to image size and for security
oshi36 Sep 7, 2023
016d9e5
Merge pull request #27 from oshi36/dockerfile_optimize
cloudyuga Sep 7, 2023
9fd0f80
changed image version from latest to v1
oshi36 Sep 22, 2023
7c0c532
Update README.md
oshi36 Sep 22, 2023
a2016a0
fixed typos
oshi36 Sep 22, 2023
2ad7e6b
Merge pull request #28 from oshi36/improved-readme
cloudyuga Sep 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
LICENSE
README.md
Dockerfile
.git
__pycache__
.tox
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.log
.Python
env


30 changes: 26 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
FROM teamcloudyuga/python:alpine
COPY . /usr/src/app
FROM python:3.9.18-slim as build
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
build-essential gcc

WORKDIR /usr/src/app
RUN python -m venv /usr/src/app/venv
ENV PATH="/usr/src/app/venv/bin:$PATH"

COPY requirements.txt .
RUN pip3 install --upgrade pip
RUN pip3 install --no-cache-dir -r requirements.txt

FROM python:3.9.18-slim
RUN groupadd -g 999 python && \
useradd -r -u 999 -g python python
RUN mkdir /usr/src/app && chown python:python /usr/src/app
WORKDIR /usr/src/app/venv
COPY --chown=python:python --from=build /usr/src/app/venv /usr/src/app/venv
COPY --chown=python:python . .
USER 999

ENV LINK http://www.meetup.com/cloudyuga/
ENV TEXT1 CloudYuga
ENV TEXT2 Garage RSVP!
ENV LOGO https://raw.githubusercontent.com/cloudyuga/rsvpapp/master/static/cloudyuga.png
ENV COMPANY CloudYuga Technology Pvt. Ltd.
RUN pip3 install -r requirements.txt
CMD python rsvp.py

ENV PATH="/usr/src/app/venv/bin:$PATH"
EXPOSE 5000
CMD ["python", "rsvp.py"]

32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# rsvpapp
# RSVP App in Python
RSVP app by CloudYuga

## Steps to run the application locally
- Clone this repository
```
git clone https://github.com/cloudyuga/rsvpapp.git
```
- Install python and pip package manager
- Install python packages mentioned in `requirements.txt` file
```
pip install -r requirements.txt
```
- Install mongodb for the database.One can use mongodb as a docker container also.
```
docker container run -d -p 27017:27017 --name=mongodb mongo:3.6
```
- Run the python app locally
```
python3 rsvp.py
```
Access the application locally on port number 5000.

## Build the Docker image of the application
- Build the Docker image from the `Dockerfile`
```
docker build -t <dockerhub_username>/rsvpapp-python:v1 .
```
- Start the frontend and backend of the application with the help of docker compose.
```
docker compose up -d
```

## Credits
Thanks to [Anand Chitipothu](https://twitter.com/anandology) for helping us with the application development.
Empty file removed __init__.py
Empty file.
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '2'
version: '3'
services:
mongodb:
image: mongo:3.3
image: mongo:3.6
expose:
- "27017"
volumes:
Expand All @@ -12,7 +12,7 @@ services:
- rsvpnet

web:
image: teamcloudyuga/rsvpapp:mooc
image: registry.cloudyuga.guru/library/rsvpapp:v1
ports:
- "5000:5000"
environment:
Expand Down
18 changes: 0 additions & 18 deletions templates/csvdata.html

This file was deleted.

11 changes: 5 additions & 6 deletions templates/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ <h3><font color="maroon"> Serving from Host: {{ hostname }} </font>
<form action="/new" method='POST'>
<div class="form-group">
<label for="name">Name:</label>
<input type="text" name="name" id="name" placeholder="Enter name" >
<input type="text" name="name" id="name" placeholder="Enter your name" >
</div>
<div class="form-group">
<label for="email">Email:</label>
<input type="text" name="email" id="email" placeholder="Enter email">
<input type="text" name="email" id="email" placeholder="Enter your email">
</div>
<button type="Submit" onclick="alert('RSVP Succeeded!')" align="center" name="submit" class="btn btn-danger">Submit</button>
</form>
Expand All @@ -34,16 +34,15 @@ <h3> RSVP Count : {{counter}} </h3>
<th class="text-center">Email</th>
</tr>
</thead>
{% for item in items %}
<tbody>
{% for item in items %}
<tr class="danger">
<td class="text-center">{{ item.name }} </td>
<td class="text-center">{{ item.email }}</td>
</tr>
{% endfor %}
</tr>
</tbody>
</tbody>
</table>

</div>
</div>
</div>
Expand Down