mirror of
https://github.com/sergeyyarkov/educt-client.git
synced 2026-10-11 10:19:22 +03:00
feat: added dockerfile
This commit is contained in:
parent
2f0cf13a40
commit
4e72abee41
15
.dockerignore
Normal file
15
.dockerignore
Normal file
@ -0,0 +1,15 @@
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
coverage
|
||||
stats.html
|
||||
Dockerfile*
|
||||
docker-compose*
|
||||
.dockerignore
|
||||
*.md
|
||||
*.local
|
||||
.git
|
||||
.gitignore
|
||||
.vscode
|
||||
.DS_STORE
|
||||
.env
|
||||
18
Dockerfile
Normal file
18
Dockerfile
Normal file
@ -0,0 +1,18 @@
|
||||
ARG NODE_IMAGE=node:14.17.3-alpine3.11
|
||||
ARG NGINX_IMAGE=nginx:1.16.0-alpine
|
||||
|
||||
FROM ${NODE_IMAGE} as builder
|
||||
WORKDIR /home/app
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM ${NGINX_IMAGE} as production
|
||||
WORKDIR /usr/share/nginx/html
|
||||
RUN rm /etc/nginx/conf.d/default.conf
|
||||
COPY --from=builder /home/app/dist /usr/share/nginx/html
|
||||
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
8
nginx/default.conf
Normal file
8
nginx/default.conf
Normal file
@ -0,0 +1,8 @@
|
||||
server {
|
||||
listen 80;
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
try_files $uri $uri/ /index.html =404;
|
||||
}
|
||||
}
|
||||
@ -3,7 +3,7 @@
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
"build": "vite build",
|
||||
"serve": "vite preview",
|
||||
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"",
|
||||
"lint": "prettier --check \"src/**/*.{js,jsx,ts,tsx}\""
|
||||
|
||||
@ -3,7 +3,7 @@ import { ChatButton } from './ChatButton';
|
||||
|
||||
export interface IAvatarProps {
|
||||
name: string;
|
||||
isOnline?: boolean | undefined;
|
||||
isOnline?: boolean | null;
|
||||
}
|
||||
|
||||
export interface IChatButtonProps {
|
||||
|
||||
@ -20,6 +20,7 @@ export default defineConfig({
|
||||
publicDir: 'public',
|
||||
plugins: [react()],
|
||||
server: {
|
||||
port: 5000,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: constants.BACKEND_URL,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user