0% found this document useful (0 votes)
4 views2 pages

Devopsnewprac Dockercomposefile2

The document is a Docker Compose configuration file that defines three services: a web server using Apache (httpd), a WordPress application, and a MySQL database. Each service is configured with specific settings such as environment variables, volume mounts, and network configurations. The setup includes persistent data storage through Docker volumes and specifies restart policies for service resilience.

Uploaded by

ASHOK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Devopsnewprac Dockercomposefile2

The document is a Docker Compose configuration file that defines three services: a web server using Apache (httpd), a WordPress application, and a MySQL database. Each service is configured with specific settings such as environment variables, volume mounts, and network configurations. The setup includes persistent data storage through Docker volumes and specifies restart policies for service resilience.

Uploaded by

ASHOK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

version: '3.

3'
services:
myweb:
image: httpd:alpine
container_name: mycustomweb
hostname: myweb
privileged: true
restart: always
stdin_open: true
user: root
working_dir: /myapp
tty: true
ports:
- target: 80
published: 9070
protocol: tcp
mode: host
volumes:
- type: volume
source: mycustomdata
target: /data
read_only: true
volume:
nocopy: true
ulimits:
#noproc: 2000
nofile:
soft: 200
hard: 900
logging:
driver: "json-file"
options:
max-size: "600k"
max-file: "10"
wordweb:
image: wordpress:latest
container_name: myfirstdb
hostname: mynewdb1
privileged: true
user: root
depends_on:
- mydb
restart: always
environment:
- WORD_DB_PASSWORD:mycustomdb1
- WORD_DB_USER:myworddb
- WORD_DB_NAME:myworddb1
- WORD_DB_HOST:db
volumes:
- type: volume
source: mycustomdata
target: /var/www/html
read_only: true
volume:
nocopy: true
networks:
mynet:
mydb:
image: mysql:5.7
container_name: mynewdb
hostname: mydb1
privileged: true
user: root
restart: always
environment:
- MYSQL_ROOT_PASSWORD:mynewdb1
- MYSQL_USER:mynewdb
- MYSQL_PASSWORD:mynewdb1
- MYSQL_DATABASE:mywordpress
volumes:
- type: volume
source: mynewdata
target: /var/lib/mysql
read_only: true
volume:
nocopy: true
networks:
mynet:

volumes:
mydata:
mynewdata:
mycustomdata:
networks:
mynet:
external: true

target: /var/lib/mysql

You might also like