diff --git a/CHANGELOG b/CHANGELOG index ad94c164d31d8baf24b10db8ee4353ea8f890be7..531a0875b781b56fb65d2d5792a45276a12f7f81 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,8 +9,10 @@ smasch (1.0.1-1) stable; urgency=low (#383) * bug fix: worker initials were not visible after changing appointments calendar view from month to week (#377) + * bug fix: statics and npm files were not served properly when accessing by + docker - -- Piotr Gawron <piotr.gawron@uni.lu> Mon, 15 Mar 2021 14:00:00 +0200 + -- Piotr Gawron <piotr.gawron@uni.lu> Wed, 17 Mar 2021 10:00:00 +0200 smasch (1.0.0-1) stable; urgency=low diff --git a/Dockerfile b/Dockerfile index 0b52e1a3990087a573d328adcf7ee6df58872505..d2ffe2cafd779475d2650a20d88e6747a9fce3d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,18 @@ RUN pip install -r requirements.txt --default-timeout=180 -i https://pypi.lcsb.u ADD . /code/ RUN cp local_settings_ci.py smash/smash/local_settings.py WORKDIR /code/smash +ENV NODE_VERSION=12.6.0 +RUN apt install -y curl +RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash +ENV NVM_DIR=/root/.nvm +RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION} +RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION} +RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION} +ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}" +RUN node --version +RUN npm --version +RUN npm install ENTRYPOINT [ "/bin/sh" ] -CMD [ "manage.py runserver 0.0.0.0:8002" ] -EXPOSE 8002 +CMD [ "manage.py runserver 0.0.0.0:8888" ] +EXPOSE 8888 diff --git a/docker-compose.yml b/docker-compose.yml index 537c9fa7e5cc498806b4cf1641568764f1940a72..69626143ef79e033c97b29df520078d225859c31 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,21 +13,21 @@ services: web: build: . expose: - - '8002' + - '8888' entrypoint: bash -c "sleep 5 && python manage.py makemigrations web && python manage.py migrate && python manage.py migrate sessions && python manage.py collectstatic --noinput && echo && echo && echo 'The server will start now...' - && gunicorn -b 0.0.0.0:8002 smash.wsgi:application --access-logfile access.log --error-logfile error.log" + && gunicorn -b 0.0.0.0:8888 smash.wsgi:application --access-logfile access.log --error-logfile error.log" ### To run the server through manage.py, use: - # && python manage.py runserver 0.0.0.0:8002" + # && python manage.py runserver 0.0.0.0:8888" ### To run the verbose tests, uncomment: # python manage.py test -v3" command: "" ports: - - "8002:8002" + - "8888:8888" volumes: - static_files:/tmp/static/ depends_on: diff --git a/docker/nginx/nginx.conf b/docker/nginx/nginx.conf index c1364344cbe114ca549cff0c6c3f7f5130952124..037089367fc17f6069e74cdd7afe8ff5d317068e 100644 --- a/docker/nginx/nginx.conf +++ b/docker/nginx/nginx.conf @@ -43,7 +43,7 @@ http { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; - proxy_pass http://web:8002; + proxy_pass http://web:8888; } } } diff --git a/docker/nginx/smasch.conf b/docker/nginx/smasch.conf index cf6558156860ff7ed87e2e6cd7f19b7d8a4ce7f0..628208b16bf5f2f043ca508cc5e814c5f1922d1e 100644 --- a/docker/nginx/smasch.conf +++ b/docker/nginx/smasch.conf @@ -46,6 +46,6 @@ server { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; - proxy_pass http://web:8002; + proxy_pass http://web:8888; } } diff --git a/local_settings_ci.py b/local_settings_ci.py index 7838de32e0637fdcf67aeeb5f8a6f80905794659..d4a43d46adad89e6967812967b38389451d1a3a3 100644 --- a/local_settings_ci.py +++ b/local_settings_ci.py @@ -4,6 +4,8 @@ SECRET_KEY = 'Paste long random string here' # Insert long random string # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True +SERVE_STATIC = True + # Database # https://docs.djangoproject.com/en/1.10/ref/settings/#databases