Browse Source

Add client dockerfile

master
Garrit Franke 4 years ago
parent
commit
260b09358c
  1. 3
      client/Dockerfile
  2. 10
      client/conf/conf.d/default.conf
  3. 2
      client/package.json

3
client/Dockerfile

@ -6,8 +6,9 @@ RUN apk add --update python make g++\
COPY . /app
WORKDIR /app
RUN npm install && npm run build
RUN npm install --verbose && npm run build
FROM nginx:alpine
COPY --from=0 /app/dist /usr/share/nginx/html
COPY ./conf/conf.d/default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80

10
client/conf/conf.d/default.conf

@ -0,0 +1,10 @@
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
}

2
client/package.json

@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"start": "parcel public/index.html",
"build": "parcel build public/index.html --public-url ./",
"build": "parcel build public/index.html --public-url './' --no-minify --no-cache",
"test": "jest --coverage"
},
"author": "Garrit Franke",

Loading…
Cancel
Save