forked from twright-msft/mssql-node-docker-demo-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (26 loc) · 840 Bytes
/
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
FROM mcr.microsoft.com/mssql/server
# Switch to root user for access to apt-get install
USER root
# Install node/npm
RUN apt-get -y update && \
apt-get install -y curl && \
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
apt-get install -y nodejs && \
apt-get install -y dos2unix
# Install tedious, the driver for SQL Server for Node.js
RUN npm install tedious
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Install app dependencies
COPY package.json /usr/src/app/
RUN npm install
# Bundle app source
COPY . /usr/src/app
RUN dos2unix *
# Grant permissions for the import-data script to be executable
RUN chmod +x /usr/src/app/import-data.sh
EXPOSE 8080
# Switch back to mssql user and run the entrypoint script
USER mssql
ENTRYPOINT /bin/bash ./entrypoint.sh