Skip to content

Commit

Permalink
#3 pulling images from ghcr, test scripts, compose adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
aavanesy committed Jan 31, 2024
1 parent d5c03dc commit 4347b7c
Show file tree
Hide file tree
Showing 11 changed files with 121 additions and 303 deletions.
16 changes: 5 additions & 11 deletions compose_files/docker-compose.maria.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,19 @@ services:

rdb_maria:
container_name: rdb_maria
image: r_mssql
image: ghcr.io/krlmlr/rdb/r-mssql
platform: linux/amd64
depends_on:
maria:
condition: service_healthy
networks:
- maria-network
volumes:
- .:/root/workspace
tty: true
stdin_open: true
# testing if connection works
# entrypoint: ["R"]
entrypoint: ["R", "-e", 'DBI::dbConnect(
RMariaDB::MariaDB(),
host = "maria",
username = "compose",
password = "YourStrong!Passw0rd",
dbname = "test")']
volumes:
# simple test
- ./test/test-maria.R:/root/workspace/.Rprofile
entrypoint: ["R"]

maria:
container_name: maria
Expand Down
19 changes: 5 additions & 14 deletions compose_files/docker-compose.mssql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,19 @@ services:
# -- MSSQL SERVICE --
rdb_mssql:
container_name: rdb_mssql
#image: ghcr.io/cynkra/dm:main
image: r_mssql
image: ghcr.io/krlmlr/rdb/r-mssql
platform: linux/amd64
depends_on:
mssql:
condition: service_healthy
networks:
- mssql-network
volumes:
- .:/root/workspace
tty: true
stdin_open: true
# entrypoint: ["R"]
entrypoint: ["R", "-e", "DBI::dbConnect(
odbc::odbc(),
driver = 'ODBC Driver 18 for SQL Server',
server = 'mssql',
database = 'test',
uid = 'SA',
pwd = 'YourStrong!Passw0rd',
port = 1433,
TrustServerCertificate = 'yes')"]
volumes:
# simple test
- ./test/test-mssql.R:/root/workspace/.Rprofile
entrypoint: ["R"]

# https://blog.logrocket.com/docker-sql-server/
mssql:
Expand Down
16 changes: 5 additions & 11 deletions compose_files/docker-compose.mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,19 @@ services:
# -- MYSQL SERVICE --
rdb_mysql:
container_name: rdb_mysql
image: r_mssql
image: ghcr.io/krlmlr/rdb/r-mssql
platform: linux/amd64
depends_on:
mysql:
condition: service_healthy
networks:
- mysql-network
volumes:
- .:/root/workspace
tty: true
stdin_open: true
# testing if connection works
# entrypoint: ["R"]
entrypoint: ["R", "-e", 'DBI::dbConnect(
RMariaDB::MariaDB(),
host = "mysql",
username = "compose",
password = "YourStrong!Passw0rd",
dbname = "test")']
volumes:
# simple test
- ./test/test-mysql.R:/root/workspace/.Rprofile
entrypoint: ["R"]

mysql:
container_name: mysql
Expand Down
17 changes: 6 additions & 11 deletions compose_files/docker-compose.oracle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,24 @@ services:

rdb_oracle:
container_name: rdb_oracle
image: r_oracle
image: ghcr.io/krlmlr/rdb/r-oracle
platform: linux/amd64
tty: true
stdin_open: true
depends_on:
oracle:
condition: service_healthy
networks:
- oracle-network
volumes:
- .:/root/workspace
tty: true
stdin_open: true
# testing if connection works
# entrypoint: ["R"]
entrypoint: ["R", "-e", "DBI::dbConnect(odbc::odbc(),
UID='compose',
PWD='password1',
Driver = 'OracleODBC-19c')"]
# simple test
- ./test/test-oracle.R:/root/workspace/.Rprofile
entrypoint: ["R"]

#https://www.oracle.com/database/technologies/oracle-database-software-downloads.html#db_free
#entreprise version requires access and license
oracle:
image: container-registry.oracle.com/database/free:latest
#command: ["/bin/bash", "-c", "/oracle_init.sh"]
container_name: oracle
ports:
- "1521:1521"
Expand Down
15 changes: 5 additions & 10 deletions compose_files/docker-compose.postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,19 @@ services:

rdb_postgres:
container_name: rdb_postgres
image: r_postgres
image: ghcr.io/krlmlr/rdb/r-postgres
platform: linux/amd64
depends_on:
postgres:
condition: service_healthy
networks:
- postgres-network
volumes:
- .:/root/workspace
tty: true
stdin_open: true
# testing if connection works
# entrypoint: ["R"]
entrypoint: ["R", "-e", "DBI::dbConnect(
RPostgres::Postgres(),
host = 'postgres',
user = 'compose',
password = 'YourStrong!Passw0rd')"]
volumes:
# simple test
- ./test/test-postgres.R:/root/workspace/.Rprofile
entrypoint: ["R"]

# https://geshan.com.np/blog/2021/12/docker-postgres/
postgres:
Expand Down
19 changes: 19 additions & 0 deletions compose_files/test/test-maria.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

# simple test script

print('Simple Test of MariaDB Connectivity')

con <- try(DBI::dbConnect(
RMariaDB::MariaDB(),
host = "maria",
username = "compose",
password = "YourStrong!Passw0rd",
dbname = "test"), silent = T)

if(class(con) == "try-error"){
print('Incorrect Setup.')
}else{
print(con)
print('Connection Correctly Configured.')
}

22 changes: 22 additions & 0 deletions compose_files/test/test-mssql.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

# simple test script

print('Simple Test of MSSQL Connectivity')

con <- try(DBI::dbConnect(
odbc::odbc(),
driver = 'ODBC Driver 18 for SQL Server',
server = 'mssql',
database = 'test',
uid = 'SA',
pwd = 'YourStrong!Passw0rd',
port = 1433,
TrustServerCertificate = 'yes'), silent = T)

if(class(con) == "try-error"){
print('Incorrect Setup.')
}else{
print(con)
print('Connection Correctly Configured.')
}

19 changes: 19 additions & 0 deletions compose_files/test/test-mysql.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

# simple test script

print('Simple Test of MySQL Connectivity')

con <- try(DBI::dbConnect(
RMariaDB::MariaDB(),
host = "mysql",
username = "compose",
password = "YourStrong!Passw0rd",
dbname = "test"), silent = T)

if(class(con) == "try-error"){
print('Incorrect Setup.')
}else{
print(con)
print('Connection Correctly Configured.')
}

17 changes: 17 additions & 0 deletions compose_files/test/test-oracle.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

# simple test script

print('Simple Test of Oracle Connectivity')

con <- try(DBI::dbConnect(odbc::odbc(),
UID='compose',
PWD='password1',
Driver = 'OracleODBC-19c'), silent = T)

if(class(con) == "try-error"){
print('Incorrect Setup.')
}else{
print(con)
print('Connection Correctly Configured.')
}

18 changes: 18 additions & 0 deletions compose_files/test/test-postgres.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

# simple test script

print('Simple Test of Postgres Connectivity')

con <- try(DBI::dbConnect(
RPostgres::Postgres(),
host = 'postgres',
user = 'compose',
password = 'YourStrong!Passw0rd'), silent = T)

if(class(con) == "try-error"){
print('Incorrect Setup.')
}else{
print(con)
print('Connection Correctly Configured.')
}

Loading

0 comments on commit 4347b7c

Please sign in to comment.