-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
executable file
·68 lines (49 loc) · 2.15 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND noninteractive
ENV TERM=xterm
# Avoid ERROR: invoke-rc.d: policy-rc.d denied execution of start.
RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d
##### Dependências #####
RUN apt-get update
ADD conf/apt-requirements /opt/sources/
ADD conf/pip-requirements /opt/sources/
WORKDIR /opt/sources/
RUN apt-get install -y --no-install-recommends $(grep -v '^#' apt-requirements)
RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash - && \
apt-get install -y nodejs && \
curl -L https://www.npmjs.com/install.sh | sh && \
npm install -g less && npm cache clean --force
RUN locale-gen en_US en_US.UTF-8 pt_BR pt_BR.UTF-8 && \
dpkg-reconfigure locales
ENV LC_ALL pt_BR.UTF-8
ADD conf/brasil-requirements /opt/sources/
RUN pip3 install setuptools && pip3 install --no-cache-dir --upgrade pip
RUN pip3 install --no-cache-dir -r pip-requirements && \
pip3 install --no-cache-dir -r brasil-requirements
ADD https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb /opt/sources/wkhtmltox.deb
RUN dpkg -i wkhtmltox.deb && rm wkhtmltox.deb
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ bionic"-pgdg main | tee /etc/apt/sources.list.d/pgdg.list
RUN apt-get update && apt-get install -y postgresql-client-11
RUN mkdir /opt/odoo/
WORKDIR /opt/odoo/
RUN mkdir private
##### Configurações Odoo #####
ADD conf/supervisord.conf /etc/supervisor/supervisord.conf
RUN mkdir /var/log/odoo && \
mkdir /opt/dados && \
mkdir /var/log/supervisord && \
touch /var/log/odoo/odoo.log && \
touch /var/run/odoo.pid && \
ln -s /opt/odoo/odoo/odoo-bin /usr/bin/odoo-server && \
ln -s /etc/odoo/odoo.conf && \
ln -s /var/log/odoo/odoo.log && \
useradd --system --home /opt --shell /bin/bash --uid 1040 odoo && \
chown -R odoo:odoo /opt && \
chown -R odoo:odoo /var/log/odoo && \
chown odoo:odoo /var/run/odoo.pid
##### Limpeza da Instalação #####
RUN apt-get autoremove -y && \
apt-get autoclean
##### Finalização do Container #####
WORKDIR /opt/odoo