mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
Add automated react build to docker-compose
This commit is contained in:
parent
560713e901
commit
2fbd71f28f
3 changed files with 31 additions and 4 deletions
4
.dockerignore
Normal file
4
.dockerignore
Normal file
|
@ -0,0 +1,4 @@
|
|||
node_modules/
|
||||
nginx/
|
||||
doc/
|
||||
build/
|
10
Dockerfile
Normal file
10
Dockerfile
Normal file
|
@ -0,0 +1,10 @@
|
|||
FROM node:latest
|
||||
|
||||
RUN mkdir /react
|
||||
RUN mkdir /result
|
||||
|
||||
VOLUME /result
|
||||
|
||||
WORKDIR /react
|
||||
|
||||
CMD npm install && npm run build && cp -R /react/build/* /result/
|
|
@ -1,16 +1,23 @@
|
|||
version: "2"
|
||||
|
||||
services:
|
||||
frontend:
|
||||
webserver:
|
||||
image: nginx:stable
|
||||
volumes:
|
||||
- ./nginx:/etc/nginx/conf.d/
|
||||
- ./build:/www
|
||||
- website-volume:/www
|
||||
links:
|
||||
- backend
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
restart: always
|
||||
|
||||
frontend:
|
||||
build: .
|
||||
volumes:
|
||||
- ./:/react
|
||||
- website-volume:/result
|
||||
|
||||
backend:
|
||||
image: villasweb-backend
|
||||
|
@ -18,8 +25,14 @@ services:
|
|||
- database
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
restart: always
|
||||
|
||||
database:
|
||||
image: mongo:latest
|
||||
# volumes:
|
||||
# - /opt/database:/data/db
|
||||
volumes:
|
||||
- data-volume:/data/db
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
data-volume:
|
||||
website-volume:
|
||||
|
|
Loading…
Add table
Reference in a new issue