Add web client dockerfiles

This commit is contained in:
Garen Tyler 2024-11-27 22:33:55 -07:00
parent 31ed9a08a9
commit 641fccfd60
Signed by: garentyler
GPG Key ID: D7A048C454CB7054
6 changed files with 46 additions and 1292 deletions

View File

@ -0,0 +1,8 @@
FROM node:23.3.0-alpine3.20
WORKDIR /app
COPY package.json .
ENV PATH=/app/node_modules/.bin:$PATH
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "run", "dev", "--", "--host"]

10
clients/web/nginx.conf Normal file
View File

@ -0,0 +1,10 @@
server {
listen 3000;
server_name localhost;
location / {
root /var/www/html;
index index.html index.htm;
try_files $uri $uri/ =404;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
FROM node:23.3.0-alpine3.20 AS builder
WORKDIR /app
COPY package.json .
RUN npm install
ENV PATH=/app/node_modules/.bin:$PATH
COPY . .
RUN npm run build
FROM nginx:1.27.3-alpine3.20
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/dist /var/www/html/
EXPOSE 3000
CMD ["nginx", "-g", "daemon off;"]

View File

@ -3,5 +3,10 @@ import vue from '@vitejs/plugin-vue'
// https://vite.dev/config/
export default defineConfig({
resolve: { alias: { '@': '/src' } },
plugins: [vue()],
server: {
host: true,
port: 3000,
}
})

View File

@ -1,4 +1,14 @@
services:
client-web:
restart: unless-stopped
build:
context: ./clients/web/
dockerfile: dev.Dockerfile
ports:
- "3000:3000"
volumes:
- ./clients/web:/app
- /app/node_modules
server:
restart: unless-stopped
build: