🔨 Add Dockerfile
This commit is contained in:
parent
4fb094b245
commit
bfb46b6c2c
35
.dockerignore
Normal file
35
.dockerignore
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
|
||||||
|
node_modules
|
||||||
|
.DS_Store
|
||||||
|
dist
|
||||||
|
dist-ssr
|
||||||
|
coverage
|
||||||
|
*.local
|
||||||
|
|
||||||
|
/cypress/videos/
|
||||||
|
/cypress/screenshots/
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/extensions.json
|
||||||
|
!.vscode/settings.json
|
||||||
|
!.vscode/launch.json
|
||||||
|
.idea
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw?
|
||||||
|
.yarn/cache
|
||||||
|
.yarn/install-state.gz
|
||||||
|
.yarn/unplugged
|
||||||
|
|
||||||
|
.eslintcache
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -30,5 +30,5 @@ coverage
|
|||||||
*.sw?
|
*.sw?
|
||||||
.yarn/cache
|
.yarn/cache
|
||||||
.yarn/install-state.gz
|
.yarn/install-state.gz
|
||||||
|
.yarn/unplugged
|
||||||
.eslintcache
|
.eslintcache
|
31
Dockerfile
Normal file
31
Dockerfile
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
FROM node:16 AS builder
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package.json .
|
||||||
|
COPY yarn.lock .
|
||||||
|
COPY .yarn/releases/* .yarn/releases/
|
||||||
|
COPY .yarnrc.yml .
|
||||||
|
RUN yarn install
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN yarn build
|
||||||
|
|
||||||
|
# nginx state for serving content
|
||||||
|
FROM nginx:alpine
|
||||||
|
# Set working directory to nginx asset directory
|
||||||
|
WORKDIR /usr/share/nginx/html
|
||||||
|
# Remove default nginx static assets
|
||||||
|
RUN rm -rf ./*
|
||||||
|
# Copy static assets from builder stage
|
||||||
|
COPY --from=builder /app/dist .
|
||||||
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
# Containers run nginx with global directives and daemon off
|
||||||
|
ENTRYPOINT ["nginx", "-g", "daemon off;"]
|
||||||
|
|
||||||
|
LABEL \
|
||||||
|
org.label-schema.name="Claptrap Bot" \
|
||||||
|
org.label-schema.url="https://claptrapbot.com" \
|
||||||
|
org.label-schema.vcs-url="https://github.com/Sebclem/Claptrap-ui" \
|
||||||
|
org.label-schema.vendor="Sebclem"
|
10
nginx.conf
Normal file
10
nginx.conf
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name frontend;
|
||||||
|
location / {
|
||||||
|
root /usr/share/nginx/html/;
|
||||||
|
index index.html;
|
||||||
|
include /etc/nginx/mime.types;
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user