Skip to content

Commit 39f4167

Browse files
committed
Primer commit2
1 parent 3c3ba31 commit 39f4167

3 files changed

Lines changed: 37 additions & 4 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Deploy Python App to CapRover
2+
3+
on:
4+
push:
5+
branches:
6+
- main # Desplegará automáticamente cada vez que se haga push a la rama 'main'
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Deploy to CapRover
17+
uses: caprover/github-action@v1.3.2
18+
with:
19+
# URL completa de tu servidor CapRover (ej: https://captain.miservidor.com)
20+
server: http://testapp.capradich.mywire.org/
21+
# El nombre de la app tal como aparece en el panel de CapRover
22+
app: testapp
23+
# Usa el secreto que creaste en GitHub
24+
token: ${{ d131f040aa97680a5043d0a0894b34fab4162c69a0ca7c230402d029586ea6e0 }}

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Use a lightweight Python base image
2-
FROM python:3.9-slim-buster
2+
FROM python:3.10-slim
33

44
# Set the working directory in the container
55
WORKDIR /app
66

77
# Copy the requirements file and install dependencies
8-
COPY requirements.txt .
8+
COPY requirements.txt ./
99
RUN pip install --no-cache-dir -r requirements.txt
1010

1111
# Copy the rest of your application code
@@ -15,4 +15,5 @@ COPY . .
1515
EXPOSE 80
1616

1717
# Command to run your application (adjust as needed for your framework)
18-
CMD ["python", "app.py"]
18+
#CMD ["gunicorn", "--bind", "0.0.0.0:80", "app:app"]
19+
CMD ["flask", "run", "--host=0.0.0.0", "--port=80"]

captain-definition

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
{
22
"schemaVersion": 2,
3-
"dockerfilePath": "./Dockerfile"
3+
"dockerfileLines": [
4+
"FROM python:3.10-slim",
5+
"WORKDIR /app",
6+
"COPY requirements.txt ./",
7+
"RUN pip install --no-cache-dir -r requirements.txt",
8+
"COPY . .",
9+
"EXPOSE 80",
10+
"CMD [\"gunicorn\", \"--bind\", \"0.0.0.0:80\", \"app:app\"]"
11+
]
412
}

0 commit comments

Comments
 (0)