mirror of https://github.com/interlegis/sapl.git
5 changed files with 73 additions and 56 deletions
@ -1,53 +1,26 @@ |
|||||
FROM ubuntu:15.04 |
FROM alpine:3.5 |
||||
|
|
||||
RUN locale-gen en_US.UTF-8 |
ENV BUILD_PACKAGES postgresql-dev graphviz-dev graphviz build-base git pkgconfig \ |
||||
ENV LANG en_US.UTF-8 |
python3-dev libxml2-dev jpeg-dev libressl-dev libffi-dev libxslt-dev nodejs py3-lxml \ |
||||
ENV LANGUAGE en_US:en |
py3-magic |
||||
ENV LC_ALL en_US.UTF-8 |
|
||||
|
|
||||
RUN mkdir /sapl |
RUN apk add --no-cache python3 && \ |
||||
|
python3 -m ensurepip && \ |
||||
|
rm -r /usr/lib/python*/ensurepip && \ |
||||
|
pip3 install --upgrade pip setuptools && \ |
||||
|
rm -r /root/.cache |
||||
|
|
||||
RUN echo "deb http://archive.ubuntu.com/ubuntu/ vivid universe" | tee -a "/etc/apt/sources.list" |
RUN mkdir /sapl && apk add --update --no-cache $BUILD_PACKAGES && npm install -g bower |
||||
|
|
||||
RUN \ |
|
||||
apt-get update && \ |
|
||||
apt-get install -y -f \ |
|
||||
software-properties-common \ |
|
||||
libpq-dev \ |
|
||||
graphviz-dev \ |
|
||||
graphviz \ |
|
||||
build-essential \ |
|
||||
git \ |
|
||||
pkg-config \ |
|
||||
python3-dev \ |
|
||||
libxml2-dev \ |
|
||||
libjpeg-dev \ |
|
||||
libssl-dev \ |
|
||||
libffi-dev \ |
|
||||
libxslt1-dev \ |
|
||||
python3-setuptools \ |
|
||||
curl |
|
||||
|
|
||||
# use python3 in pip |
|
||||
RUN easy_install3 pip lxml |
|
||||
|
|
||||
# install nodejs |
|
||||
RUN DEBIAN_FRONTEND=noninteractive curl -sL https://deb.nodesource.com/setup_5.x | bash - |
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs |
|
||||
|
|
||||
# install bower |
|
||||
RUN npm install -g bower |
|
||||
|
|
||||
# Bower aceitar root |
# Bower aceitar root |
||||
RUN touch /root/.bowerrc |
RUN touch /root/.bowerrc \ |
||||
RUN chmod 751 /root/.bowerrc |
&& chmod 751 /root/.bowerrc \ |
||||
RUN echo "{ \"allow_root\": true }" >> /root/.bowerrc |
&& echo "{ \"allow_root\": true }" >> /root/.bowerrc \ |
||||
|
&& npm cache clean |
||||
|
|
||||
WORKDIR /sapl |
WORKDIR /sapl |
||||
|
|
||||
ADD . /sapl |
ADD . /sapl |
||||
|
|
||||
RUN pip install -r requirements/dev-requirements.txt |
RUN pip install -r requirements/dev-requirements.txt --upgrade setuptools --no-cache-dir \ |
||||
RUN pip install --upgrade setuptools |
&& python3 manage.py bower install |
||||
|
|
||||
# RUN python3 manage.py bower install |
|
||||
|
|||||
@ -0,0 +1,39 @@ |
|||||
|
upstream sapl_server { |
||||
|
|
||||
|
server unix:/sapl/run/gunicorn.sock fail_timeout=0; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
server { |
||||
|
|
||||
|
listen 80; |
||||
|
server_name sapl.test; |
||||
|
|
||||
|
client_max_body_size 4G; |
||||
|
|
||||
|
location /static/ { |
||||
|
alias /sapl/collected_static/; |
||||
|
} |
||||
|
|
||||
|
location /media/ { |
||||
|
alias /sapl/media/; |
||||
|
} |
||||
|
|
||||
|
location / { |
||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
||||
|
|
||||
|
proxy_set_header Host $http_host; |
||||
|
|
||||
|
proxy_redirect off; |
||||
|
|
||||
|
|
||||
|
if (!-f $request_filename) { |
||||
|
proxy_pass http://sapl_server; |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
error_page 500 502 503 504 /500.html; |
||||
|
location = /500.html { |
||||
|
root /sapl/sapl/static/; |
||||
|
} |
||||
|
} |
||||
@ -1,2 +1,3 @@ |
|||||
#!/bin/bash |
#!/bin/bash |
||||
docker run -ti sapl_web /bin/bash |
|
||||
|
docker run --rm -ti sapl_web /bin/sh |
||||
|
|||||
Loading…
Reference in new issue