-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
executable file
·31 lines (23 loc) · 1.04 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
# We choose exact tag (not 'latest'), to be sure that new version won't break creating image
FROM mcr.microsoft.com/mssql/server:2017-CU17-ubuntu
COPY conf /var/opt/mssql
COPY cert/server.crt /etc/ssl/certs
COPY cert/server.key /etc/ssl/private
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Copy initialization scripts
COPY . /usr/src/app
# COPY sql /usr/src/app
# Grant permissions for the run-initialization script to be executable
RUN chmod +x /usr/src/app/run-initialization.sh
# Set environment variables, not to have to write them with docker run command
# Note: make sure that your password matches what is in the run-initialization script
ENV SA_PASSWORD z!x<?oB1ab
ENV ACCEPT_EULA Y
ENV MSSQL_PID Express
# Expose port 1433 in case accesing from other container
EXPOSE 1433
# Run Microsoft SQl Server and initialization script (at the same time)
# Note: If you want to start MsSQL only (without initialization script) you can comment bellow line out, CMD entry from base image will be taken
CMD /bin/bash ./entrypoint.sh