|
1 |
| -FROM ubuntu:trusty |
| 1 | +FROM redash/base:latest |
2 | 2 |
|
3 |
| -# Ubuntu packages |
4 |
| -RUN apt-get update && \ |
5 |
| - apt-get install -y python-pip python-dev curl build-essential pwgen libffi-dev sudo git-core wget \ |
6 |
| - # Postgres client |
7 |
| - libpq-dev \ |
8 |
| - # Additional packages required for data sources: |
9 |
| - libssl-dev libmysqlclient-dev freetds-dev libsasl2-dev && \ |
10 |
| - apt-get clean && \ |
11 |
| - rm -rf /var/lib/apt/lists/* |
| 3 | +# We first copy only the requirements file, to avoid rebuilding on every file |
| 4 | +# change. |
| 5 | +COPY requirements.txt requirements_dev.txt requirements_all_ds.txt ./ |
| 6 | +RUN pip install -r requirements.txt -r requirements_dev.txt -r requirements_all_ds.txt |
12 | 7 |
|
13 |
| -# Users creation |
14 |
| -RUN useradd --system --comment " " --create-home redash |
| 8 | +COPY . ./ |
15 | 9 |
|
16 |
| -# Pip requirements for all data source types |
17 |
| -RUN pip install -U setuptools==23.1.0 && \ |
18 |
| - pip install supervisor==3.1.2 |
19 |
| - |
20 |
| -COPY . /opt/redash/current |
21 |
| -RUN chown -R redash /opt/redash/current |
22 |
| - |
23 |
| -# Setting working directory |
24 |
| -WORKDIR /opt/redash/current |
25 |
| - |
26 |
| -# Install project specific dependencies |
27 |
| -RUN pip install -r requirements_all_ds.txt && \ |
28 |
| - pip install -r requirements.txt |
29 |
| - |
30 |
| -RUN curl https://deb.nodesource.com/setup_4.x | bash - && \ |
31 |
| - apt-get install -y nodejs && \ |
32 |
| - sudo -u redash -H make deps && \ |
33 |
| - rm -rf node_modules client/node_modules /home/redash/.npm /home/redash/.cache && \ |
34 |
| - apt-get purge -y nodejs && \ |
35 |
| - apt-get clean && \ |
36 |
| - rm -rf /var/lib/apt/lists/* |
37 |
| - |
38 |
| -# Setup supervisord |
39 |
| -RUN mkdir -p /opt/redash/supervisord && \ |
40 |
| - mkdir -p /opt/redash/logs && \ |
41 |
| - cp /opt/redash/current/setup/docker/supervisord/supervisord.conf /opt/redash/supervisord/supervisord.conf |
42 |
| - |
43 |
| -# Fix permissions |
44 |
| -RUN chown -R redash /opt/redash |
45 |
| - |
46 |
| -# Expose ports |
47 |
| -EXPOSE 5000 |
48 |
| -EXPOSE 9001 |
49 |
| - |
50 |
| -# Startup script |
51 |
| -CMD ["supervisord", "-c", "/opt/redash/supervisord/supervisord.conf"] |
| 10 | +ENTRYPOINT ["/app/bin/docker-entrypoint"] |
0 commit comments