diff --git a/Makefile b/Makefile index c6b14f379..fe00fe8c5 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,9 @@ rebuild: - RUNWITHMAKEBUILD=True CURRENT_UID=${CURRENT_UID} CURRENT_GID=${CURRENT_GID} docker-compose down - RUNWITHMAKEBUILD=True CURRENT_UID=${CURRENT_UID} CURRENT_GID=${CURRENT_GID} docker-compose up -d +collectstatic: + - docker run --rm -v $(shell pwd):/srv/newsblur --platform linux/amd64 newsblur/newsblur_deploy + #creates newsblur, builds new images, and creates/refreshes SSL keys nb: pull - RUNWITHMAKEBUILD=True CURRENT_UID=${CURRENT_UID} CURRENT_GID=${CURRENT_GID} docker-compose down @@ -103,14 +106,18 @@ build_node: - docker image build . --platform linux/amd64 --file=docker/node/Dockerfile --tag=newsblur/newsblur_node build_monitor: - docker image build . --platform linux/amd64 --file=docker/monitor/Dockerfile --tag=newsblur/newsblur_monitor -build: build_web build_node build_monitor +build_deploy: + - docker image build . --platform linux/amd64 --file=docker/newsblur_deploy.Dockerfile --tag=newsblur/newsblur_deploy +build: build_web build_node build_monitor build_deploy push_web: build_web - docker push newsblur/newsblur_python3 push_node: build_node - docker push newsblur/newsblur_node push_monitor: build_monitor - docker push newsblur/newsblur_monitor -push_images: push_web push_node push_monitor +push_deploy: build_deploy + - docker push newsblur/newsblur_deploy +push_images: push_web push_node push_monitor push_deploy push: build push_images # Tasks diff --git a/docker/newsblur_deploy.Dockerfile b/docker/newsblur_deploy.Dockerfile new file mode 100644 index 000000000..5aba8e224 --- /dev/null +++ b/docker/newsblur_deploy.Dockerfile @@ -0,0 +1,11 @@ +FROM newsblur/newsblur_python3 +ENV DOCKERBUILD=True + +RUN apt update +RUN apt install -y curl +RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - +RUN apt install -y nodejs build-essential +RUN npm -g install yuglify + +WORKDIR /srv/newsblur +CMD python manage.py collectstatic --no-input \ No newline at end of file diff --git a/newsblur_web/entrypoint.sh b/newsblur_web/entrypoint.sh index 554c5cb4c..732f43dec 100755 --- a/newsblur_web/entrypoint.sh +++ b/newsblur_web/entrypoint.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash if [[ -z "${TEST}" && "${TEST}" = "True" ]] -then echo "starting test env" +then echo " ---> Starting test env" else python3 manage.py check_db; gunicorn -c config/gunicorn_conf.py newsblur_web.wsgi:application fi diff --git a/newsblur_web/settings.py b/newsblur_web/settings.py index 24430003b..772a09ffc 100644 --- a/newsblur_web/settings.py +++ b/newsblur_web/settings.py @@ -796,8 +796,8 @@ with open(os.path.join(ROOT_DIR, 'assets.yml')) as stream: PIPELINE = { 'PIPELINE_ENABLED': True, 'PIPELINE_ROOT': NEWSBLUR_DIR, - 'CSS_COMPRESSOR': 'pipeline.compressors.NoopCompressor', - 'JS_COMPRESSOR': 'pipeline.compressors.NoopCompressor', + 'CSS_COMPRESSOR': 'pipeline.compressors.yuglify.YuglifyCompressor', + 'JS_COMPRESSOR': 'pipeline.compressors.yuglify.YuglifyCompressor', 'JAVASCRIPT': { 'common': { 'source_filenames': assets['javascripts']['common'], @@ -818,9 +818,9 @@ PIPELINE = { 'blurblog': { 'source_filenames': assets['javascripts']['blurblog'], 'output_filename': 'js/blurblog.js', + }, }, 'STYLESHEETS': { - }, 'common': { 'source_filenames': assets['stylesheets']['common'], 'output_filename': 'css/common.css',