Node.js Sybase databases using ODBC.
315
This project provides a Docker-based solution for connecting Node.js applications to Sybase databases using ODBC.
There are two ways to configure the database connection:
Mount the following configuration files:
/etc/freetds/freetds.conf[global]
[DSN]
charset = cp1251
host = DB_HOST
port = DB_PORT
tds version = 5.0
/etc/odbc.ini[DSN]
DRIVER=FreeTDS
SERVER=DB_HOST
PORT=DB_PORT
TDS_Version = 5.0
Create a Dockerfile with the following content:
FROM sergey12313/node-odbc-sybase
ARG DB_USER
ARG DB_PASSWORD
ARG DB_HOST
ARG DB_PORT=5000
ARG DSN=SYBASE_MAIN
ENV DB_USER=${DB_USER}
ENV DB_PASSWORD=${DB_PASSWORD}
ENV DB_HOST=${DB_HOST}
ENV DB_PORT=${DB_PORT}
ENV DSN=${DSN}
COPY package*.json ./
COPY tsconfig.json ./
RUN npm install --only=development
COPY src src
RUN npm run build
RUN npm ci --omit=dev
RUN /usr/local/bin/init-config.sh
CMD ["node", "dist/index.js"]
Build the Docker image using the following command:
docker build \
--build-arg DB_USER=your_user \
--build-arg DB_HOST=your_host \
--build-arg DB_PORT=your_port \
-t my-app .
Run the container with the following command:
docker run \
-e DB_USER=your_user \
-e DB_PASSWORD=your_password \
-e DB_HOST=your_host \
-e DB_PORT=your_port \
my-app
| Variable | Description | Default |
|---|---|---|
| DB_USER | Database username | - |
| DB_PASSWORD | Database password | - |
| DB_HOST | Database host | - |
| DB_PORT | Database port | 5000 |
| DSN | Data Source Name | SYBASE_MAIN |
Content type
Image
Digest
sha256:2aa715548…
Size
63.5 MB
Last updated
over 1 year ago
docker pull sergey12313/node-odbc-sybase