Skip to content

Commit b0e12c4

Browse files
committed
ops: Docker config
1 parent 1dece38 commit b0e12c4

File tree

4 files changed

+54
-0
lines changed

4 files changed

+54
-0
lines changed

.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules
2+
dist
3+
.vscode
4+
.DS_Store
5+
.git
6+
.gitignore
7+
npm-debug.log
8+
yarn-error.log

Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Étape 1 : Build Vue
2+
FROM node:22-alpine AS build
3+
WORKDIR /app
4+
5+
COPY package*.json ./
6+
RUN npm ci
7+
8+
COPY . .
9+
RUN npm run build
10+
11+
# Étape 2 : Serve avec Nginx
12+
FROM nginx:alpine
13+
# Copie du build Vue
14+
COPY --from=build /app/dist /usr/share/nginx/html
15+
# Copie de la config Nginx
16+
COPY nginx.conf /etc/nginx/conf.d/default.conf
17+
18+
EXPOSE 80
19+
CMD ["nginx", "-g", "daemon off;"]

docker-compose.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: "3.8"
2+
3+
services:
4+
thecode:
5+
build: .
6+
image: thecode:latest
7+
container_name: thecode
8+
restart: unless-stopped
9+
ports:
10+
- "127.0.0.1:8002:80" # hôte:container

nginx.conf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
server {
2+
listen 80;
3+
server_name _;
4+
5+
root /usr/share/nginx/html;
6+
index index.html;
7+
8+
# Google verification exact
9+
location = /google8031792c6641dc1d.html {
10+
try_files $uri =404;
11+
}
12+
13+
# SPA fallback
14+
location / {
15+
try_files $uri /index.html;
16+
}
17+
}

0 commit comments

Comments
 (0)