Skip to content
Snippets Groups Projects
Commit 04041d1d authored by ncastejon's avatar ncastejon
Browse files

Merge webapp & nginx Docker services into one.

parent 5f27e167
Branches
Tags
No related merge requests found
# Stage 0, based on Node.js, to build and compile Angular
FROM node:8.10.0 as builder
# Copy the current directory contents into the container at /app
COPY ./webapp /app/webapp
WORKDIR /app/webapp
# Install npm dependencies
RUN npm install
# Building the Angular app /dist i18n
RUN npm run build-i18n
# Stage 1, based on Nginx, to have only the compiled app
FROM nginx FROM nginx
COPY --from=builder /app/webapp/dist /usr/share/nginx/html
## Install dependency to get lua module in .conf
RUN apt-get update RUN apt-get update
RUN apt-get --yes --force-yes install nginx-extras
RUN apt-get --yes --force-yes install nginx-extras
\ No newline at end of file
version: "2" version: "2"
services: services:
node-server:
build: ./webapp
proxy-elasticsearch: proxy-elasticsearch:
image: nginx image: nginx
volumes: volumes:
...@@ -17,7 +13,6 @@ services: ...@@ -17,7 +13,6 @@ services:
context: ./ context: ./
volumes: volumes:
- ./webapp-nginx.conf:/etc/nginx/conf.d/default.conf - ./webapp-nginx.conf:/etc/nginx/conf.d/default.conf
- ./webapp/dist:/usr/share/nginx/html
ports: ports:
- 8080:8080 - 8080:8080
...@@ -14,7 +14,6 @@ for lang in (ngx.var.http_accept_language .. ","):gmatch("([^,]*),") do ...@@ -14,7 +14,6 @@ for lang in (ngx.var.http_accept_language .. ","):gmatch("([^,]*),") do
ngx.redirect("/fr/") ngx.redirect("/fr/")
end end
end end
ngx.redirect("/en/")
'; ';
#rewrite ^/$ /en/ permanent; #rewrite ^/$ /en/ permanent;
......
FROM node:8.10.0
# Copy the current directory contents into the container at /app
COPY . /app/webapp
#COPY ../node-server /app/node-server
WORKDIR /app/webapp
# Install npm dependencies
RUN npm install
# Building the Angular app /dist i18n
RUN npm run win-build-i18n:fr
#RUN cp -r ./dist ../node-server/dist
# Set the working directory to /node-server
#WORKDIR /app/node-server
# Install npm dependencies
#RUN npm install
#EXPOSE 8080
#CMD npm start
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment