Skip to content

Instantly share code, notes, and snippets.

@ruman
Created June 15, 2023 07:13
Show Gist options
  • Save ruman/c4897f6c222a9e8de20003c2bf36a266 to your computer and use it in GitHub Desktop.
Save ruman/c4897f6c222a9e8de20003c2bf36a266 to your computer and use it in GitHub Desktop.
Docker Compose file for React APP #nginx #redis #react #mariadb #postgresSQL #network
version: '3.7'
services:
simple_react:
container_name: simple_react
# image: node:11.9.0-alpine
image: node:12.16.2-alpine
volumes:
- type: bind
source: ./
target: /react
# command: bin/sh -c "cd /react/ && npm install && npm audit fix -f && npm run dev"
command: bin/sh -c "echo '172.28.0.10 myapp.local' >> /etc/hosts && tail -f /dev/null"
ports:
- '6000:3000'
- '1390:4000'
links:
- php
- nginx
networks:
- backend
mariadb:
build: ./mariadb
environment:
# MYSQL_RANDOM_ROOT_PASSWORD: 1
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: mydb
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
# command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci # The simple way to override the mariadb config.
ports:
- '3350:3306'
volumes:
- ./data/mariadb:/var/lib/mysql
- ./mariadb/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
networks:
- backend
# - ./docker-runtime/mariadb-init:/docker-entrypoint-initdb.d # Place init .sql file(s) here.
# postgresdb:
# image: postgres:9.6
# networks:
# - backend
# environment:
# POSTGRES_USER: postgres
# POSTGRES_DB: database_production
# POSTGRES_PASSWORD: postgres
# POSTGRES_HOST_AUTH_METHOD: trust
# volumes:
# - ./postgres_data:/var/lib/postgresql/data
# ports:
# - "5442:5432"
php:
build: ./php-fpm
# image: rumaneee/wordpress_php
# command: docker-php-ext-install mysql
environment:
PHP_SITE_NAME: dev
PHP_HOST_NAME: qi_kurs
# PHP_DOCROOT: public # Relative path inside the /var/www/html/ directory.
PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
PHP_XDEBUG_ENABLED: 0 # Set 1 to enable
PHP_UPLOAD_MAX_FILESIZE: 1G
PHP_MAX_INPUT_VARS: 2G
volumes:
- ./:/var/www/html
networks:
- backend
nginx:
# image: rumaneee/wordpress_nginx
build: ./nginx
environment:
NGINX_SERVER_NAME: localhost
NGINX_UPSTREAM_NAME: php`
NGINX_HOST_NAME: qi_kurs.local
# NGINX_DOCROOT: public # Relative path inside the /var/www/html/ directory.
volumes:
- ./:/var/www/html
- ./nginx/sites:/etc/nginx/sites-available
ports:
- "80:80"
- "8088:8088"
networks:
backend:
ipv4_address: 172.28.0.10
redis:
image: "redis:alpine"
command: redis-server
ports:
- "6379:6379"
volumes:
- ./redis/data:/var/lib/redis
- ./redis/redis.conf:/usr/local/etc/redis/redis.conf
restart: always
container_name: redis
networks:
backend:
ipv4_address: 172.28.0.11
networks:
backend:
driver: "bridge"
ipam:
config:
- subnet: 172.28.0.0/16
ip_range: 172.28.0.0/24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment