docker files added

This commit is contained in:
Deepak 2026-06-10 16:53:14 +05:30
parent 54541998c5
commit 41f493840b
2 changed files with 90 additions and 0 deletions

54
Dockerfile Normal file
View File

@ -0,0 +1,54 @@
FROM python:3.12-bookworm
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# System dependencies
RUN apt-get update && apt-get install -y \
build-essential \
gcc \
g++ \
git \
curl \
npm \
libpq-dev \
libldap2-dev \
libsasl2-dev \
libxml2-dev \
libxslt1-dev \
libjpeg62-turbo-dev \
zlib1g-dev \
libffi-dev \
libssl-dev \
liblcms2-dev \
wkhtmltopdf \
&& rm -rf /var/lib/apt/lists/*
# Less compiler used by Odoo
RUN npm install -g less less-plugin-clean-css
# Create odoo user
RUN useradd -m -d /opt/odoo -U -r -s /bin/bash odoo
WORKDIR /opt/odoo/odoo18
# Copy project
COPY . .
# Upgrade pip tools
RUN pip install --upgrade pip setuptools wheel
# Install requirements
RUN pip install --no-cache-dir -r requirements.txt
# PostgreSQL driver
RUN pip install psycopg2-binary
# Permissions
RUN chown -R odoo:odoo /opt/odoo
USER odoo
EXPOSE 8069
CMD ["python3", "odoo-bin", "-c", "odoo.conf"]

36
docker-compose.yml Normal file
View File

@ -0,0 +1,36 @@
services:
db:
image: postgres:15
container_name: odoo18-db
environment:
POSTGRES_DB: postgres
POSTGRES_USER: odoo
POSTGRES_PASSWORD: admin
volumes:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped
odoo:
build:
context: .
dockerfile: Dockerfile
container_name: odoo18-app
depends_on:
- db
ports:
- "8069:8069"
volumes:
- .:/opt/odoo/odoo18
restart: unless-stopped
volumes:
postgres_data: