testing docker stuff
This commit is contained in:
parent
99f06955dc
commit
642015b368
20
Dockerfile
20
Dockerfile
@ -4,15 +4,21 @@ RUN apk add --no-cache postgresql-libs gettext zlib libjpeg libxml2-dev libxslt-
|
|||||||
ENV PYTHONUNBUFFERED 1
|
ENV PYTHONUNBUFFERED 1
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
RUN mkdir /opt/recipes
|
RUN apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev zlib-dev jpeg-dev
|
||||||
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 && \
|
COPY requirements.txt requirements.txt
|
||||||
python -m venv venv && \
|
|
||||||
|
RUN python -m venv venv && \
|
||||||
venv/bin/pip install -r requirements.txt --no-cache-dir &&\
|
venv/bin/pip install -r requirements.txt --no-cache-dir &&\
|
||||||
apk --purge del .build-deps
|
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"]
|
ENTRYPOINT ["/opt/recipes/boot.sh"]
|
4
boot.sh
4
boot.sh
@ -1,10 +1,12 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
cd /opt/recipes
|
||||||
|
|
||||||
source venv/bin/activate
|
source venv/bin/activate
|
||||||
|
|
||||||
echo "Updating database"
|
echo "Updating database"
|
||||||
python manage.py migrate
|
python manage.py migrate
|
||||||
python manage.py collectstatic --noinput
|
|
||||||
python manage.py collectstatic_js_reverse
|
python manage.py collectstatic_js_reverse
|
||||||
|
python manage.py collectstatic --noinput
|
||||||
echo "Done"
|
echo "Done"
|
||||||
|
|
||||||
chmod -R 755 /opt/recipes/mediafiles
|
chmod -R 755 /opt/recipes/mediafiles
|
||||||
|
14
cookbook/static/django_js_reverse/reverse.js
Normal file
14
cookbook/static/django_js_reverse/reverse.js
Normal file
File diff suppressed because one or more lines are too long
@ -58,7 +58,7 @@
|
|||||||
{% if debug %}
|
{% if debug %}
|
||||||
<script src="{% url 'js_reverse' %}"></script>
|
<script src="{% url 'js_reverse' %}"></script>
|
||||||
{% else %}
|
{% else %}
|
||||||
<script src="{% static 'django_js_reverse/js/reverse.js' %}"></script>
|
<script src="{% static 'django_js_reverse/reverse.js' %}"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
@ -206,6 +206,9 @@ LANGUAGES = [
|
|||||||
# Static files (CSS, JavaScript, Images)
|
# Static files (CSS, JavaScript, Images)
|
||||||
# https://docs.djangoproject.com/en/2.0/howto/static-files/
|
# 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_URL = os.getenv('STATIC_URL', '/static/')
|
||||||
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")
|
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user