From 3004eb16d41e1d0482709e8d559421fd74b60b0a Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Fri, 2 Apr 2021 06:44:12 -0600 Subject: [PATCH 1/3] Add missing groceryitem.order migration. The new field was introduced in a4e781e82 without a migration. --- v1/list/migrations/0010_auto_20210402_0743.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 v1/list/migrations/0010_auto_20210402_0743.py diff --git a/v1/list/migrations/0010_auto_20210402_0743.py b/v1/list/migrations/0010_auto_20210402_0743.py new file mode 100644 index 0000000..882556a --- /dev/null +++ b/v1/list/migrations/0010_auto_20210402_0743.py @@ -0,0 +1,18 @@ +# Generated by Django 2.1.7 on 2021-04-02 12:43 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('list', '0009_ordered_grocery_item'), + ] + + operations = [ + migrations.AlterField( + model_name='groceryitem', + name='order', + field=models.IntegerField(default=0, verbose_name='order'), + ), + ] From b86f09694ffa6f001cda1f513df0feac967b09e3 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Fri, 2 Apr 2021 06:51:41 -0600 Subject: [PATCH 2/3] Update to python 3.9/alpine3.13 Newer Python is its own reward, and there's some new MySQL tech I'll need in alpine 3.13. I had to remove py-mysqldb as it's no longer available in alpine3.13. That's fine though, as mariadb-connector-c provides the necessary c-level libraries and other Python requirements are provided through pip. mariadb-connector-c also provides the newer caching_sha2_password.so library for authentication to newer MySQL databasese. --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c8fdb2b..2e54538 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.6.5-alpine3.7 +FROM python:3.9.2-alpine3.13 ENV PYTHONUNBUFFERED 1 RUN apk update && apk upgrade && \ @@ -6,7 +6,7 @@ RUN apk update && apk upgrade && \ gcc \ mariadb \ mariadb-dev \ - py-mysqldb \ + mariadb-connector-c \ musl-dev \ libjpeg-turbo-dev \ zlib-dev From 6250f10b4d3e5da45cf8a696f61f74b0daa8b554 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Fri, 2 Apr 2021 07:21:10 -0600 Subject: [PATCH 3/3] Update Dockerfile to work standalone. In general users will use the separate OpenEats repository which defines the docker-compose file necessary to run an entire install together. This is fine, but some advanced users may want to run the containers separately. Without these changes it isn't clear which ports are exposed and the container does not actually do anything. --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2e54538..d6eb09c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,4 +18,8 @@ RUN mkdir /code WORKDIR /code ADD base/requirements.txt /code/requirements.txt RUN pip install -r requirements.txt -ADD . /code/ \ No newline at end of file +ADD . /code/ +VOLUME /code/static-files +ENV API_PORT=8000 +EXPOSE 8000 +ENTRYPOINT ["/startup/prod-entrypoint.sh"]