Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
arogachev committed Dec 2, 2024
1 parent bcea166 commit c7e8975
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 232 deletions.
246 changes: 89 additions & 157 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,173 +42,105 @@ services:
APP_USER: my_user
APP_USER_PASSWORD: password_i_should_change
command: tail -F anything
php-oracle:
depends_on:
mysql:
condition: service_healthy
mariadb:
condition: service_healthy
postgres:
condition: service_healthy
mssql:
condition: service_healthy
oracle:
condition: service_healthy
mysql:
image: mysql:9
ports:
- "3306:3306"
volumes:
- type: tmpfs
target: /var/lib/mysql
environment:
MYSQL_DATABASE: yii
MYSQL_ROOT_PASSWORD: root
MYSQL_ROOT_HOST: "%"
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost", "-uroot" ]
interval: 5s
timeout: 5s
retries: 20
mariadb:
image: mariadb:11
ports:
- "13306:3306"
volumes:
- type: tmpfs
target: /var/lib/mysql
environment:
MYSQL_DATABASE: yii
MYSQL_ROOT_PASSWORD: root
MYSQL_ROOT_HOST: "%"
MYSQL_TCP_PORT: 13306
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
start_period: 10s
interval: 10s
timeout: 5s
retries: 30
postgres:
image: postgres:17
ports:
- "5432:5432"
volumes:
- type: tmpfs
target: /var/lib/postgresql/data
environment:
POSTGRES_DB: yii
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 5
mssql:
image: mcr.microsoft.com/mssql/server:2022-latest
ports:
- "1433:1433"
user: root
volumes:
- mssql-data:/var/opt/mssql/data
- mssql-log:/var/opt/mssql/log
- mssql-secrets:/var/opt/mssql/secrets
environment:
SA_PASSWORD: YourStrong!Passw0rd
ACCEPT_EULA: Y
healthcheck:
test: /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "$${SA_PASSWORD}" -Q "SELECT 1" -b -C -o /dev/null
interval: 10s
timeout: 3s
retries: 100
start_period: 10s
oracle:
build:
context: docker/oracle
context: docker/oracle
ports:
- "1521:1521"
volumes:
- ./src:/code/src
- ./tests:/code/tests
- ./composer.json:/code/composer.json
- ./phpunit.xml.dist:/code/phpunit.xml.dist
- php-oracle-data:/opt/oracle/oradata
- oracle-data:/opt/oracle/oradata
environment:
YII_MYSQL_DATABASE: yii
YII_MYSQL_HOST: mysql
YII_MYSQL_PORT: 3306
YII_MYSQL_USER: root
YII_MYSQL_PASSWORD: root
YII_MYSQL_TYPE: mysql

YII_MARIADB_DATABASE: yii
YII_MARIADB_HOST: mariadb
YII_MARIADB_PORT: 13306
YII_MARIADB_USER: root
YII_MARIADB_PASSWORD: root

YII_PGSQL_DATABASE: yii
YII_PGSQL_HOST: postgres
YII_PGSQL_PORT: 5432
YII_PGSQL_USER: postgres
YII_PGSQL_PASSWORD: postgres

YII_MSSQL_DATABASE: tempdb
YII_MSSQL_HOST: mssql
YII_MSSQL_PORT: 1433
YII_MSSQL_USER: SA
YII_MSSQL_PASSWORD: YourStrong!Passw0rd

YII_ORACLE_SID: FREE
YII_ORACLE_HOST: 172.17.0.1
YII_ORACLE_PORT: 1521
YII_ORACLE_USER: system
YII_ORACLE_PASSWORD: sys_user_password

ORACLE_PASSWORD: sys_user_password
APP_USER: my_user
APP_USER_PASSWORD: password_i_should_change
command: tail -F anything
# depends_on:
# mysql:
# condition: service_healthy
# mariadb:
# condition: service_healthy
# postgres:
# condition: service_healthy
# mssql:
# condition: service_healthy
# oracle:
# condition: service_healthy
# mysql:
# image: mysql:9
# ports:
# - "3306:3306"
# volumes:
# - type: tmpfs
# target: /var/lib/mysql
# environment:
# MYSQL_DATABASE: yii
# MYSQL_ROOT_PASSWORD: root
# MYSQL_ROOT_HOST: "%"
# healthcheck:
# test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost", "-uroot" ]
# interval: 5s
# timeout: 5s
# retries: 20
# mariadb:
# image: mariadb:11
# ports:
# - "13306:3306"
# volumes:
# - type: tmpfs
# target: /var/lib/mysql
# environment:
# MYSQL_DATABASE: yii
# MYSQL_ROOT_PASSWORD: root
# MYSQL_ROOT_HOST: "%"
# MYSQL_TCP_PORT: 13306
# healthcheck:
# test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
# start_period: 10s
# interval: 10s
# timeout: 5s
# retries: 30
# postgres:
# image: postgres:17
# ports:
# - "5432:5432"
# volumes:
# - type: tmpfs
# target: /var/lib/postgresql/data
# environment:
# POSTGRES_DB: yii
# POSTGRES_USER: postgres
# POSTGRES_PASSWORD: postgres
# healthcheck:
# test: [ "CMD-SHELL", "pg_isready -U postgres" ]
# interval: 5s
# timeout: 5s
# retries: 5
# mssql:
# image: mcr.microsoft.com/mssql/server:2022-latest
# ports:
# - "1433:1433"
# user: root
# volumes:
# - mssql-data:/var/opt/mssql/data
# - mssql-log:/var/opt/mssql/log
# - mssql-secrets:/var/opt/mssql/secrets
# environment:
# SA_PASSWORD: YourStrong!Passw0rd
# ACCEPT_EULA: Y
# healthcheck:
# test: /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "$${SA_PASSWORD}" -Q "SELECT 1" -b -C -o /dev/null
# interval: 10s
# timeout: 3s
# retries: 100
# start_period: 10s
# oracle:
# build:
# context: docker/oracle
# ports:
# - "1521:1521"
# volumes:
# - oracle-data:/opt/oracle/oradata
# environment:
# ORACLE_PASSWORD: sys_user_password
# APP_USER: my_user
# APP_USER_PASSWORD: password_i_should_change
# healthcheck:
# test: ["CMD", "healthcheck.sh"]
# interval: 10s
# timeout: 5s
# retries: 100
# start_period: 5s
# start_interval: 5s
# test1:
# build:
# context: docker/test1
# volumes:
# - test1-oracle-data:/opt/oracle/oradata
# environment:
# ORACLE_PASSWORD: sys_user_password
# APP_USER: my_user
# APP_USER_PASSWORD: password_i_should_change
# command: tail -F anything
# entrypoint: /opt/oracle/container-entrypoint.sh
# healthcheck:
# test: [ "CMD", "/opt/oracle/healthcheck.sh" ]
# interval: 10s
# timeout: 5s
# retries: 100
# start_period: 5s
# start_interval: 5s
healthcheck:
test: ["CMD", "healthcheck.sh"]
interval: 10s
timeout: 5s
retries: 100
start_period: 5s
start_interval: 5s
volumes:
php-oracle-data:
mssql-data:
mssql-log:
mssql-secrets:
oracle-data:
# test-oracle-data:
test1-oracle-data:
27 changes: 1 addition & 26 deletions docker/oracle/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
FROM --platform=linux/amd64 db-php:latest AS php

FROM gvenzl/oracle-free:23 AS oracle

COPY --from=php /usr/local/lib/php/ /usr/local/lib/php/
COPY --from=php /usr/local/include/php/ /usr/local/include/php/
COPY --from=php /usr/local/php/ /usr/local/php/
COPY --from=php /usr/local/bin/php /usr/local/bin/php
COPY --from=php /usr/local/bin/php-config /usr/local/bin/php-config
COPY --from=php /usr/local/etc/php/ /usr/local/etc/php/

COPY --from=php /usr/lib/x86_64-linux-gnu/*.so* /usr/lib/x86_64-linux-gnu/
COPY --from=php /usr/lib/x86_64-linux-gnu/*.so* /usr/lib64/

COPY --from=php /opt/* /opt/
COPY --from=php /usr/local/instantclient_23_5/ /usr/local/instantclient_23_5/

COPY --from=php /code/ /code/

COPY --from=php /root/.bashrc /root/.bashrc

USER root
RUN ln -s /usr/local/instantclient_23_5 /usr/local/instantclient
RUN ln -s /usr/local/instantclient/lib* /usr/lib
RUN ln -s /usr/local/instantclient/sqlplus /usr/bin/sqlplus
USER oracle
FROM gvenzl/oracle-free:23

RUN chown -R 54321:54321 /opt/oracle/oradata && chmod 0777 /opt/oracle/oradata
33 changes: 0 additions & 33 deletions docker/test/Dockerfile

This file was deleted.

16 changes: 0 additions & 16 deletions docker/test1/Dockerfile

This file was deleted.

0 comments on commit c7e8975

Please sign in to comment.