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
|
||||
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"]
|
4
boot.sh
4
boot.sh
@ -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
|
||||
|
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 %}
|
||||
<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 %}
|
||||
|
||||
|
||||
|
@ -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")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user