forked from phuuthanh-dev/jewelry-auction-be
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ab902fe
commit a6ffac6
Showing
2 changed files
with
23 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
# Dùng official SQL Server 2019 image của Microsoft | ||
FROM mcr.microsoft.com/mssql/server:2019-latest | ||
|
||
# Biến môi trường | ||
ENV ACCEPT_EULA=Y | ||
ENV SA_PASSWORD=Thanhth@nh1 | ||
|
||
COPY init.sql /docker-entrypoint-initdb.d/init.sql | ||
# Copy the SQL script vào container | ||
COPY init.sql /usr/src/app/init.sql | ||
|
||
# Chạy lệnh trong file sql | ||
RUN /opt/mssql/bin/sqlservr & sleep 30 \ | ||
&& /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $SA_PASSWORD -i /usr/src/app/init.sql \ | ||
&& pkill sqlservr | ||
|
||
EXPOSE 1433 | ||
# Khởi động sql server | ||
CMD ["/opt/mssql/bin/sqlservr"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
version: '3.0' | ||
|
||
services: | ||
auction-database: | ||
image: ghcr.io/phuuthanh2003/auction-database:latest | ||
ports: | ||
- "1433:1433" | ||
environment: | ||
SA_PASSWORD: "Thanhth@nh1" | ||
ACCEPT_EULA: "Y" | ||
|
||
auction-api: | ||
image: ghcr.io/phuuthanh2003/auction-api:latest | ||
ports: | ||
- "8085:8080" | ||
- "8080:8080" | ||
depends_on: | ||
- auction-database | ||
|
||
auction-database: | ||
image: ghcr.io/phuuthanh2003/auction-database:latest | ||
environment: | ||
- ACCEPT_EULA=Y | ||
- SA_PASSWORD=Thanhth@nh1 | ||
ports: | ||
- "1433:1433" | ||
SPRING_DATASOURCE_URL: jdbc:sqlserver://auction-database:1433;encrypt=true;trustServerCertificate=true;databaseName=DB_AUCTION; | ||
SPRING_DATASOURCE_USERNAME: sa | ||
SPRING_DATASOURCE_PASSWORD: Thanhth@nh1 |