Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
PHP App
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IF3110-2023-02-32
PHP App
Commits
d3954ec0
Commit
d3954ec0
authored
Nov 13, 2023
by
Genvictus
Browse files
Options
Downloads
Patches
Plain Diff
chore: config for docker-config
parent
e5e43410
No related branches found
No related tags found
No related merge requests found
Pipeline
#59536
failed
Nov 13, 2023
Stage: build
Stage: test
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
.env.default
+5
-7
5 additions, 7 deletions
.env.default
docker-compose.yml
+11
-20
11 additions, 20 deletions
docker-compose.yml
scripts/build-image.sh
+1
-1
1 addition, 1 deletion
scripts/build-image.sh
src/app/config/config.php
+5
-5
5 additions, 5 deletions
src/app/config/config.php
with
22 additions
and
33 deletions
.env.default
+
5
−
7
View file @
d3954ec0
# Use this as template for creating .env environment file
POSTGRES_USER=tubeswbd
POSTGRES_PASSWORD=tubes1Password
POSTGRES_DB=tubes-db
MONOLITHIC_
POSTGRES_USER=
"
tubeswbd
"
MONOLITHIC_
POSTGRES_PASSWORD=
"
tubes1Password
"
MONOLITHIC_
POSTGRES_DB=
"
tubes-db
"
POSTGRES_HOST=pg_container
POSTGRES_PORT=5432
MONOLITHIC_POSTGRES_PORT="5432"
PGADMIN_DEFAULT_EMAIL: "tubeswbd@tubes.com"
PGADMIN_DEFAULT_PASSWORD: "tubes1Password"
\ No newline at end of file
MONOLITHIC_POSTGRES_HOST="monolithic_postgres"
This diff is collapsed.
Click to expand it.
docker-compose.yml
+
11
−
20
View file @
d3954ec0
version
:
'
3.3'
services
:
web
:
image
:
tubes-1:latest
php-
web
:
image
:
php-app
ports
:
-
8008:80
depends_on
:
-
postgres
-
php-
postgres
env_file
:
-
.env
volumes
:
-
./src:/var/www/html
# Source: https://github.com/alexeagleson/docker-node-postgres-template/blob/master/docker-compose.yml
postgres
:
container_name
:
${POSTGRES_HOST}
php-postgres
:
image
:
postgres:16-alpine
container_name
:
${MONOLITHIC_POSTGRES_HOST}
restart
:
always
env_file
:
-
.env
environment
:
POSTGRES_USER
:
${MONOLITHIC_POSTGRES_USER}
POSTGRES_PASSWORD
:
${MONOLITHIC_POSTGRES_PASSWORD}
POSTGRES_DB
:
${MONOLITHIC_POSTGRES_DB}
ports
:
# Standard port for PostgreSQL databases
-
"
5432:${POSTGRES_PORT}"
-
"
5432:${
MONOLITHIC_
POSTGRES_PORT}"
volumes
:
# When the PostgresSQL container is started it will run any scripts
# provided in the `docker-entrypoint-initdb.d` directory, this connects
# our seed file to that directory so that it gets run
-
./migration/database-seed.sql:/docker-entrypoint-initdb.d/database-seed.sql
\ No newline at end of file
# PostgreSQL pgAdmin panel accessible at http://localhost:16543/
pgadmin-compose
:
image
:
dpage/pgadmin4
restart
:
always
env_file
:
-
.env
ports
:
-
"
16543:80"
depends_on
:
-
postgres
\ No newline at end of file
This diff is collapsed.
Click to expand it.
scripts/build-image.sh
+
1
−
1
View file @
d3954ec0
docker build
-t
tubes-1:latest .
\ No newline at end of file
docker build
-t
php-app .
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/app/config/config.php
+
5
−
5
View file @
d3954ec0
...
...
@@ -6,11 +6,11 @@ define('SECONDS_MINUTE', 60);
define
(
'SECONDS_HOUR'
,
3600
);
/* -- Database Configuration -- */
define
(
'DBNAME'
,
$_ENV
[
'POSTGRES_DB'
]);
define
(
'DBUSER'
,
$_ENV
[
'POSTGRES_USER'
]
??
'postgres'
);
define
(
'DBPASSWORD'
,
$_ENV
[
'POSTGRES_PASSWORD'
]);
define
(
'DBHOST'
,
$_ENV
[
'POSTGRES_HOST'
]);
define
(
'DBPORT'
,
$_ENV
[
'POSTGRES_PORT'
]);
define
(
'DBNAME'
,
$_ENV
[
'
MONOLITHIC_
POSTGRES_DB'
]);
define
(
'DBUSER'
,
$_ENV
[
'
MONOLITHIC_
POSTGRES_USER'
]
??
'postgres'
);
define
(
'DBPASSWORD'
,
$_ENV
[
'
MONOLITHIC_
POSTGRES_PASSWORD'
]);
define
(
'DBHOST'
,
$_ENV
[
'
MONOLITHIC_
POSTGRES_HOST'
]);
define
(
'DBPORT'
,
$_ENV
[
'
MONOLITHIC_
POSTGRES_PORT'
]);
define
(
'CONNECT_RETRIES'
,
4
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment