Skip to content

Commit c79fa64

Browse files
committed
Pruebas actualización Docker
1 parent f8c04f2 commit c79fa64

6 files changed

Lines changed: 102 additions & 18 deletions

File tree

Dockerfile

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.6-buster
1+
FROM python:3.11.14
22

33
ENV DEBIAN_FRONTEND=noninteractive
44
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1
@@ -13,29 +13,25 @@ EXPOSE 8000
1313

1414
WORKDIR $PYCAN_DIR
1515

16-
17-
RUN apt-get update \
18-
&& apt-get install --no-install-recommends -y \
19-
ca-certificates \
20-
postgresql-client \
21-
libpq-dev \
22-
binutils \
23-
libproj-dev \
24-
gdal-bin \
25-
&& rm -rf /var/lib/apt/lists/*
26-
16+
RUN apt-get update || :
17+
RUN apt-get install --no-install-recommends -y postgresql-client
18+
RUN apt-get install --no-install-recommends -y ca-certificates
19+
RUN apt-get install --no-install-recommends -y libpq-dev
20+
RUN apt-get install --no-install-recommends -y binutils
21+
RUN apt-get install --no-install-recommends -y libproj-dev
22+
RUN apt-get install --no-install-recommends -y gdal-bin
23+
RUN rm -rf /var/lib/apt/lists/*
2724

2825
RUN python3 -m venv $VIRTUAL_ENV
2926
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
3027

31-
3228
COPY requirements.txt requirements-dev.txt ./
3329

3430
RUN pip install --upgrade pip && \
3531
pip install -r requirements.txt && \
3632
pip install -r requirements-dev.txt
3733

3834
# Fix an ipython bug: https://github.com/ipython/ipython/issues/12677
39-
RUN pip install jedi==0.17.2
35+
RUN pip install jedi==0.17.2
4036

4137
CMD ["./manage.py", "runserver", "0.0.0.0:8000"]

apps/events/models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ class Meta:
3636
Venue, related_name="events", null=True, blank=True, on_delete=models.PROTECT
3737
)
3838
# 50 minutes as default duration for each slot
39-
default_slot_duration = models.DurationField(default=50 * 60)
39+
default_slot_duration = models.DurationField(
40+
default=50 * 60,
41+
help_text='En segundos, por ejemplo 50 minutos = 3000 (50*60)',
42+
)
4043
short_description = models.TextField(
4144
blank=True,
4245
help_text="Shown in events list",

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Environment variables that control some of the behaviours in this file:
2+
23
# PYCAN_DB_PORT=5432
34
# PYCAN_APP_PORT=8000
4-
5-
version: '3.3'
5+
:
66
services:
77
database:
88
image: 'postgres:10.17'

export_database.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
source ~/.pyenv/versions/pycanweb/bin/activate
44

5-
function dump () {
5+
function dumpdata () {
66
echo -n "Dumping $1";
77
./manage.py dumpdata --verbosity 1 --indent 4 $1 > ./fixtures/$1.json
88
}

import_database.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
3+
source ~/.virtualenvs/pycanweb/bin/activate
4+
5+
function loaddata () {
6+
echo -n "Loading $1";
7+
./manage.py loaddata --verbosity 1 ./fixtures/$1.json;
8+
echo "[OK]";
9+
}
10+
11+
# unzip -o backup.zip
12+
13+
loaddata "auth"
14+
loaddata "about"
15+
loaddata "api"
16+
loaddata "admin"
17+
loaddata "certificates"
18+
loaddata "contenttypes"
19+
loaddata "staticfiles"
20+
loaddata "flatpages"
21+
loaddata "commons"
22+
loaddata "events"
23+
loaddata "homepage"
24+
loaddata "invoices"
25+
loaddata "jobs"
26+
loaddata "learn"
27+
loaddata "legal"
28+
loaddata "locations"
29+
loaddata "members"
30+
loaddata "messages"
31+
loaddata "notices"
32+
loaddata "organizations"
33+
loaddata "quotes"
34+
loaddata "schedule"
35+
loaddata "sessions"
36+
loaddata "sites"
37+
loaddata "speakers"
38+
loaddata "tickets"
39+

pyproject.toml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
[project]
2+
name = "pycan-web"
3+
version = "1.0.0"
4+
description = "Python Canarias Web Site"
5+
readme = "README.md"
6+
requires-python = ">=3.12"
7+
dependencies = [
8+
"black>=26.1.0",
9+
"colorama==0.4.4",
10+
"django==3.2.25",
11+
"django-colorfield==0.1.15",
12+
"django-debug-toolbar>=4.3.0",
13+
"django-extensions==3.1.0",
14+
"django-import-export==2.7.1",
15+
"django-leaflet==0.31.0",
16+
"django-redis==5.4.0",
17+
"django-rq==3.1",
18+
"flake8>=7.3.0",
19+
"ipython>=9.10.0",
20+
"markdown2==2.4.0",
21+
"markuppy==1.14",
22+
"odfpy==1.4.1",
23+
"openpyxl==3.0.3",
24+
"pillow==11.1.0",
25+
"prettyconf==2.1.0",
26+
"psycopg2-binary==2.9.9",
27+
"pydotplus>=2.0.2",
28+
"pyqrcode==1.2.1",
29+
"pytest>=9.0.2",
30+
"pytest-django>=4.12.0",
31+
"pytest-sugar>=1.1.1",
32+
"pyyaml==6.0.2",
33+
"qr==0.6.0",
34+
"redis==6.4.0",
35+
"reportlab==4.2.2",
36+
"rope>=1.14.0",
37+
"rq==2.4.1",
38+
"sendgrid==5.6.0",
39+
"stripe==10.6.0",
40+
"tabulate==0.8.9",
41+
"tweepy==3.10.0",
42+
"uwsgi==2.0.26",
43+
"werkzeug==1.0.1",
44+
"xlrd==1.2.0",
45+
"xlwt==1.3.0",
46+
]

0 commit comments

Comments
 (0)