Commit 2fbd71f2 authored by Markus Grigull's avatar Markus Grigull

Add automated react build to docker-compose

parent 560713e9
node_modules/
nginx/
doc/
build/
FROM node:latest
RUN mkdir /react
RUN mkdir /result
VOLUME /result
WORKDIR /react
CMD npm install && npm run build && cp -R /react/build/* /result/
version: "2" version: "2"
services: services:
frontend: webserver:
image: nginx:stable image: nginx:stable
volumes: volumes:
- ./nginx:/etc/nginx/conf.d/ - ./nginx:/etc/nginx/conf.d/
- ./build:/www - website-volume:/www
links: links:
- backend - backend
ports: ports:
- "80:80" - "80:80"
- "443:443" - "443:443"
restart: always
frontend:
build: .
volumes:
- ./:/react
- website-volume:/result
backend: backend:
image: villasweb-backend image: villasweb-backend
...@@ -18,8 +25,14 @@ services: ...@@ -18,8 +25,14 @@ services:
- database - database
environment: environment:
- NODE_ENV=production - NODE_ENV=production
restart: always
database: database:
image: mongo:latest image: mongo:latest
# volumes: volumes:
# - /opt/database:/data/db - data-volume:/data/db
restart: always
volumes:
data-volume:
website-volume:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment