Add a Docker Compose file for production
This commit is contained in:
parent
08ad9bab9e
commit
8d557df62a
29
docker-compose.production.yaml
Normal file
29
docker-compose.production.yaml
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
version: '2.4'
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: tools/docker/images/nginx/Dockerfile
|
||||||
|
volumes:
|
||||||
|
- html:/app
|
||||||
|
ports:
|
||||||
|
- 80:80
|
||||||
|
depends_on:
|
||||||
|
- app
|
||||||
|
- assets
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
app:
|
||||||
|
volumes:
|
||||||
|
- assets:/app/source/build
|
||||||
|
- html:/app/output_prod
|
||||||
|
- .:/app
|
||||||
|
command: generate -e prod
|
||||||
|
|
||||||
|
assets:
|
||||||
|
entrypoint: npm
|
||||||
|
command: run production
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
html:
|
2
tools/docker/images/nginx/Dockerfile
Normal file
2
tools/docker/images/nginx/Dockerfile
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
FROM nginx:1 as base
|
||||||
|
COPY tools/docker/images/nginx/root /
|
13
tools/docker/images/nginx/root/etc/nginx/conf.d/default.conf
Normal file
13
tools/docker/images/nginx/root/etc/nginx/conf.d/default.conf
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
root /app;
|
||||||
|
index index.html index.htm;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 404 /404.html;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue