diff --git a/Dockerfile b/Dockerfile index 649ea8c..9307e76 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,15 +5,9 @@ RUN mkdir -p /usr/src/app WORKDIR /usr/src/app # Install app dependencies -COPY package.json /usr/src/app/ -RUN npm install +COPY . /usr/src/app +RUN npm install && npm run build VOLUME /usr/src/app/build -# Bundle app source -COPY . /usr/src/app -RUN npm run build - -EXPOSE 80 - -CMD [ "npm", "start" ] +CMD [ "true" ] diff --git a/backend b/backend index 22e594a..c3bbf18 160000 --- a/backend +++ b/backend @@ -1 +1 @@ -Subproject commit 22e594a848798a79f0ab90e6e0a6ff2fe3d91e8b +Subproject commit c3bbf18279b892374c8998a455d57ec8acc92501 diff --git a/docker-compose.yml b/docker-compose.yml index 6e984cf..3ae3f92 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,9 +3,7 @@ version: "2" volumes: database: driver: local - -networks: - villas: + website: services: # Build the frontend with node into a Docker volume @@ -14,7 +12,8 @@ services: frontend: build: context: . - command: "/bin/true" + volumes: + - website:/usr/src/app/build nginx: build: @@ -23,10 +22,8 @@ services: ports: - "80:80" - "443:443" - volumes_from: - - frontend - networks: - villas: + volumes: + - website:/www # The VILLASweb backend backend: @@ -34,8 +31,6 @@ services: environment: - NODE_ENV=production restart: always - networks: - villas: # The MongoDB database for the VILLASweb backend database: @@ -43,12 +38,8 @@ services: user: mongodb volumes: - database:/data/db - expose: - - "27017" restart: always user: mongodb - networks: - villas: # AMQP broker for VILLAScontroller # broker: @@ -70,5 +61,3 @@ services: privileged: true restart: always command: node /etc/villas/node/websocket-demo.conf - networks: - villas: diff --git a/etc/nginx/villas.conf b/etc/nginx/villas.conf index a745f91..4dabe64 100644 --- a/etc/nginx/villas.conf +++ b/etc/nginx/villas.conf @@ -27,7 +27,7 @@ server { # frontend location location / { - root /usr/src/app/build/; + root /www; } # error pages