2017-01-01 21:01:01 -06:00
|
|
|
FROM python:3.6
|
2017-01-15 20:14:58 -06:00
|
|
|
RUN apt-get install curl
|
|
|
|
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
|
|
|
|
RUN apt-get install -y nodejs
|
2016-07-08 10:04:42 -06:00
|
|
|
RUN mkdir /code
|
|
|
|
WORKDIR /code
|
|
|
|
RUN mkdir requirements
|
2017-01-15 20:14:58 -06:00
|
|
|
ADD bikeshop_project /code
|
2017-01-23 19:44:49 -06:00
|
|
|
ADD requirements/base.txt /code/requirements/base.txt
|
2017-02-16 22:53:49 -06:00
|
|
|
ADD requirements/testing.txt /code/requirements/testing.txt
|
2017-01-23 19:44:49 -06:00
|
|
|
ADD requirements/production.txt /code/requirements/production.txt
|
2017-09-10 18:20:12 +00:00
|
|
|
COPY production.py /code/bikeshop/settings
|
2017-01-15 20:14:58 -06:00
|
|
|
RUN pip install -r requirements/production.txt
|
|
|
|
RUN npm cache clean
|
2017-01-23 13:42:51 -06:00
|
|
|
ADD ./bikeshop_project/bower.json bower.json
|
2017-01-15 21:15:25 -06:00
|
|
|
RUN npm install --unsafe-perm -g bower
|
|
|
|
RUN bower install --allow-root
|
2017-01-23 13:42:51 -06:00
|
|
|
ADD ./bikeshop_project/package.json package.json
|
2017-01-15 20:14:58 -06:00
|
|
|
RUN npm install --unsafe-perm
|
|
|
|
RUN npm run build-production
|
2017-02-16 22:53:49 -06:00
|
|
|
RUN DJANGO_SETTINGS_MODULE=bikeshop.settings.production python manage.py test
|
|
|
|
CMD 'bash -c "PYTHONUNBUFFERED=TRUE python manage.py migrate --no-input && python manage.py collectstatic --no-input && python manage.py rebuild_index --noinput && gunicorn --log-file=- -b 0.0.0.0:8000 bikeshop.wsgi:application"'
|
2017-01-16 19:39:11 -06:00
|
|
|
EXPOSE 8000
|