This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Compose file version | |
version: "3.9" | |
# services | |
services: | |
# frontend (php-apache web server) | |
frontend: | |
image: php:8.0.0-apache-buster | |
volumes: | |
- "./www:/var/www/html" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Flag | Description | |
---|---|---|
no | Do not automatically restart the container. (the default) | |
on-failure | Restart the container if it exits due to an error, which manifests as a non-zero exit code. | |
always | Always restart the container if it stops. If it is manually stopped, it is restarted only when Docker daemon restarts or the container itself is manually restarted. (See the second bullet listed in restart policy details) | |
unless-stopped | Similar to always, except that when the container is stopped (manually or otherwise), it is not restarted even after Docker daemon restarts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Compose file version | |
version: "3.9" | |
# services | |
services: | |
# frontend (php-apache web server) | |
frontend: | |
image: php:8.0.0-apache-buster | |
volumes: | |
- "./www:/var/www/html" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require( "express" ); | |
const axios = require( "axios" ); | |
const redis = require( "redis" ); | |
// create redis client | |
const redisClient = redis.createClient( "redis://cache:6379" ); | |
redisClient.on( 'error', ( error ) => { | |
console.log( '[BACKEND]: redis connection error', error ); | |
} ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# parent image | |
FROM node:15.4.0-alpine3.10 | |
# set working directory | |
WORKDIR /app | |
# install dependencies | |
ADD package.json package-lock.json ./ | |
RUN npm install --production |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang='en'> | |
<head> | |
<meta charset='UTF-8'> | |
<meta name='viewport' content='width=device-width, initial-scale=1.0'> | |
<title>Docker Compose App</title> | |
</head> | |
<body> | |
<ul> | |
<?php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Compose file version | |
version: "3.9" | |
# services | |
services: | |
# frontend (php-apache web server) | |
frontend: | |
image: php:8.0.0-apache-buster | |
volumes: | |
- "./www:/var/www/html" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Compose file version | |
version: "3.9" | |
# services | |
services: | |
# frontend web service | |
frontend: | |
image: nginx:${NGINX_VERSION} | |
volumes: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Compose file version | |
version: "3.9" | |
# services | |
services: | |
# frontend web service | |
frontend: | |
build: | |
context: ./frontend |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Compose file version | |
version: "3.9" | |
# services | |
services: | |
# frontend web service | |
frontend: | |
image: nginx:${NGINX_VERSION} | |
volumes: |