Skip to content

Commit 90a9f80

Browse files
committed
feat(docker): improve docker-compose
Add networks and container names.
1 parent fa1c5f9 commit 90a9f80

File tree

2 files changed

+33
-12
lines changed

2 files changed

+33
-12
lines changed

client/ng/src/environments/environment.base.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {Environment} from './environment.model';
22

33
export const environmentBase = {
44
api: {
5-
baseUrl: '127.0.0.1:8000',
5+
baseUrl: 'http://127.0.0.1:8000',
66
path: {
77
auth: '/authentication.php',
88
mail: '/mail.php',

docker-compose.yml

+32-11
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,46 @@
1-
version: '3.8'
1+
name: jeudemots
22
services:
3-
4-
# TODO: Frontend - serve the Angular app
3+
#
4+
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
5+
#
6+
# TODO
57
# frontend:
68
# image: nginx:stable
79
# depends_on:
810
# - api
911
# ports:
1012
# - 80:80
11-
12-
# API - run PHP app
13+
#
14+
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
15+
#
1316
api:
17+
container_name: jeudemots-api
1418
image: php:7.2-apache
19+
command: | # TODO: convert that to a Dockerfile
20+
/bin/sh -c 'docker-php-ext-install mysqli &&
21+
exec docker-php-entrypoint apache2-foreground'
1522
depends_on:
1623
- db
1724
volumes:
1825
- ./server/src:/var/www/html:ro
1926
ports:
2027
- 8000:80
21-
22-
# Database - store jokes in a MySQL db
28+
networks: ['backend']
29+
#
30+
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
31+
#
2332
db:
33+
container_name: jeudemots-db
2434
image: mariadb:10.3
2535
restart: always
2636
environment:
2737
MYSQL_ROOT_PASSWORD: 'devonly'
28-
29-
# Database Admin Panel
38+
networks: ['backend']
39+
#
40+
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
41+
#
3042
phpmyadmin:
43+
container_name: jeudemots-phpmyadmin
3144
image: phpmyadmin:5
3245
depends_on:
3346
- db
@@ -36,6 +49,14 @@ services:
3649
PMA_USER: 'root'
3750
PMA_PASSWORD: 'devonly'
3851
ports:
39-
- 8080:80 # internal
40-
52+
- 8080:80
53+
networks: ['backend', 'frontend']
54+
#
55+
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
56+
#
57+
networks:
58+
frontend:
59+
name: jeudemots-frontend
60+
backend:
61+
name: jeudemots-backend
4162

0 commit comments

Comments
 (0)