Skip to content

Commit c0da204

Browse files
authored
feat: add Dockerfile and nginx.conf (#6)
1 parent 6e49eb6 commit c0da204

File tree

3 files changed

+101
-0
lines changed

3 files changed

+101
-0
lines changed

.dockerignore

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Dépendances
2+
node_modules
3+
.pnpm-store
4+
5+
# Fichiers de build
6+
dist
7+
build
8+
9+
# Environnement
10+
.env
11+
.env.local
12+
.env.development.local
13+
.env.test.local
14+
.env.production.local
15+
16+
# Fichiers d'éditeur
17+
.idea
18+
.vscode
19+
*.swp
20+
*.swo
21+
22+
# Fichiers système
23+
.DS_Store
24+
Thumbs.db
25+
26+
# Logs
27+
npm-debug.log*
28+
pnpm-debug.log*
29+
yarn-debug.log*
30+
yarn-error.log*
31+
logs
32+
*.log
33+
34+
# Cache
35+
.astro
36+
.eslintcache
37+
.cache
38+
39+
# Tests
40+
coverage
41+
.nyc_output
42+
43+
# Fichiers Docker (pour éviter la récursion)
44+
Dockerfile
45+
.dockerignore
46+
docker-compose*
47+
48+
# Fichiers Git
49+
.git
50+
.gitignore

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM node:20-alpine AS build
2+
3+
RUN corepack enable && corepack prepare [email protected] --activate
4+
5+
WORKDIR /app
6+
7+
COPY pnpm-lock.yaml package.json ./
8+
9+
RUN pnpm install --frozen-lockfile
10+
11+
COPY . .
12+
13+
RUN pnpm build
14+
15+
FROM nginx:1.28.0-alpine3.21-slim AS runtime
16+
17+
COPY ./nginx.conf /etc/nginx/nginx.conf
18+
COPY --from=build /app/dist /usr/share/nginx/html
19+
20+
EXPOSE 8080

nginx.conf

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
worker_processes 1;
2+
3+
events {
4+
worker_connections 1024;
5+
}
6+
7+
http {
8+
server {
9+
listen 8080;
10+
server_name _;
11+
12+
root /usr/share/nginx/html;
13+
index index.html index.htm;
14+
include /etc/nginx/mime.types;
15+
16+
gzip on;
17+
gzip_min_length 1000;
18+
gzip_proxied expired no-cache no-store private auth;
19+
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
20+
21+
error_page 404 /404.html;
22+
location = /404.html {
23+
root /usr/share/nginx/html;
24+
internal;
25+
}
26+
27+
location / {
28+
try_files $uri $uri/index.html =404;
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)