Skip to content
Snippets Groups Projects
Commit a8c33871 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch 'docker-issue' into 'devel_1.0.x'

Docker issue

See merge request NCER-PD/scheduling-system!313
parents 8c7c6b90 2aeeff97
No related branches found
No related tags found
3 merge requests!316Merge 1.0.1,!3151.0.1 into master,!313Docker issue
Pipeline #38494 passed
......@@ -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
......
......@@ -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
......@@ -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:
......
......@@ -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;
}
}
}
......@@ -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;
}
}
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment