testing docker stuff

This commit is contained in:
vabene1111 2021-01-13 22:17:40 +01:00
parent 99f06955dc
commit 642015b368
6 changed files with 34 additions and 14 deletions

View File

@ -4,15 +4,21 @@ RUN apk add --no-cache postgresql-libs gettext zlib libjpeg libxml2-dev libxslt-
ENV PYTHONUNBUFFERED 1
EXPOSE 8080
RUN mkdir /opt/recipes
WORKDIR /opt/recipes
COPY . ./
RUN chmod +x boot.sh setup.sh
RUN ln -s /opt/recipes/setup.sh /usr/local/bin/createsuperuser
RUN apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev zlib-dev jpeg-dev
RUN apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev zlib-dev jpeg-dev && \
python -m venv venv && \
COPY requirements.txt requirements.txt
RUN python -m venv venv && \
venv/bin/pip install -r requirements.txt --no-cache-dir &&\
apk --purge del .build-deps
RUN mkdir /opt/recipes
WORKDIR /opt/recipes
COPY . ./
RUN chmod +x boot.sh
WORKDIR /opt/recipes/vue
RUN yarn install
RUN yarn build
ENTRYPOINT ["/opt/recipes/boot.sh"]

View File

@ -1,10 +1,12 @@
#!/bin/sh
cd /opt/recipes
source venv/bin/activate
echo "Updating database"
python manage.py migrate
python manage.py collectstatic --noinput
python manage.py collectstatic_js_reverse
python manage.py collectstatic --noinput
echo "Done"
chmod -R 755 /opt/recipes/mediafiles

File diff suppressed because one or more lines are too long

View File

@ -58,7 +58,7 @@
{% if debug %}
<script src="{% url 'js_reverse' %}"></script>
{% else %}
<script src="{% static 'django_js_reverse/js/reverse.js' %}"></script>
<script src="{% static 'django_js_reverse/reverse.js' %}"></script>
{% endif %}

View File

@ -206,6 +206,9 @@ LANGUAGES = [
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.0/howto/static-files/
# path for django_js_reverse to generate the javascript file containing all urls. Only done because the default command (collectstatic_js_reverse) fails to update the manifest
JS_REVERSE_OUTPUT_PATH = os.path.join(BASE_DIR, "cookbook/static/django_js_reverse")
STATIC_URL = os.getenv('STATIC_URL', '/static/')
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")

View File

@ -1,5 +0,0 @@
#!/bin/sh
source venv/bin/activate
echo "Creating Superuser."
python manage.py createsuperuser
echo "Done"