mirror of
https://github.com/appen-isen/projet-cal.git
synced 2026-01-18 16:47:38 +01:00
feat: new design + dockerize app
This commit is contained in:
38
.dockerignore
Normal file
38
.dockerignore
Normal file
@@ -0,0 +1,38 @@
|
||||
# Git
|
||||
.git
|
||||
.gitignore
|
||||
.gitattributes
|
||||
|
||||
# Documentation
|
||||
README.md
|
||||
*.md
|
||||
|
||||
# IDE
|
||||
.vscode
|
||||
.idea
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
|
||||
# Build artifacts
|
||||
backend/main
|
||||
*.exe
|
||||
|
||||
# Logs
|
||||
*.log
|
||||
|
||||
# OS files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Node modules (if any)
|
||||
node_modules
|
||||
|
||||
# Test files
|
||||
*_test.go
|
||||
|
||||
# Bruno API client
|
||||
backend/API-Projet-CAL
|
||||
|
||||
# Makefile
|
||||
Makefile
|
||||
46
Dockerfile
Normal file
46
Dockerfile
Normal file
@@ -0,0 +1,46 @@
|
||||
# Multi-stage build for optimized image size
|
||||
FROM golang:1.23-alpine AS backend-builder
|
||||
|
||||
# Install build dependencies
|
||||
RUN apk add --no-cache git
|
||||
|
||||
# Set working directory for backend
|
||||
WORKDIR /app/backend
|
||||
|
||||
# Copy go mod files
|
||||
COPY backend/go.mod backend/go.sum ./
|
||||
|
||||
# Download dependencies
|
||||
RUN go mod download
|
||||
|
||||
# Copy backend source code
|
||||
COPY backend/ ./
|
||||
|
||||
# Build the application
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .
|
||||
|
||||
# Final stage - minimal image
|
||||
FROM alpine:latest
|
||||
|
||||
# Install ca-certificates for HTTPS requests
|
||||
RUN apk --no-cache add ca-certificates tzdata
|
||||
|
||||
# Set timezone (adjust as needed)
|
||||
ENV TZ=Europe/Paris
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the built binary from builder
|
||||
COPY --from=backend-builder /app/backend/main .
|
||||
|
||||
# Copy frontend files
|
||||
COPY frontend/ ./frontend/
|
||||
|
||||
# Copy backend data file
|
||||
COPY backend/date_link.txt ./
|
||||
|
||||
# Expose port
|
||||
EXPOSE 8080
|
||||
|
||||
# Run the application
|
||||
CMD ["./main"]
|
||||
1
backend/.env.example
Normal file
1
backend/.env.example
Normal file
@@ -0,0 +1 @@
|
||||
FILE_NAME=date_link.txt
|
||||
17
docker-compose.yml
Normal file
17
docker-compose.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
calendrier-avent:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: calendrier-avent-isen
|
||||
ports:
|
||||
- "8080:8080"
|
||||
environment:
|
||||
- FILE_NAME=date_link.txt
|
||||
- GIN_MODE=release
|
||||
volumes:
|
||||
# Mount date_link.txt so you can update it without rebuilding
|
||||
- ./backend/date_link.txt:/app/date_link.txt:ro
|
||||
restart: unless-stopped
|
||||
@@ -1,19 +1,44 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Calendrier de l'Avent</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Jim+Nightshade&display=swap" rel="stylesheet">
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Poppins:wght@300;400;600&display=swap"
|
||||
rel="stylesheet">
|
||||
<link rel="stylesheet" href="static/style.css">
|
||||
<link rel="icon" href="static/assets/favicon.png" type="image/x-icon">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="background-blur"></div>
|
||||
<div class="snowflakes" aria-hidden="true">
|
||||
<div class="snowflake">❅</div>
|
||||
<div class="snowflake">❆</div>
|
||||
<div class="snowflake">❅</div>
|
||||
<div class="snowflake">❆</div>
|
||||
<div class="snowflake">❅</div>
|
||||
<div class="snowflake">❆</div>
|
||||
<div class="snowflake">❅</div>
|
||||
<div class="snowflake">❆</div>
|
||||
<div class="snowflake">❅</div>
|
||||
<div class="snowflake">❆</div>
|
||||
<div class="snowflake">❅</div>
|
||||
<div class="snowflake">❆</div>
|
||||
<div class="snowflake">❅</div>
|
||||
<div class="snowflake">❆</div>
|
||||
<div class="snowflake">❅</div>
|
||||
<div class="snowflake">❆</div>
|
||||
<div class="snowflake">❅</div>
|
||||
<div class="snowflake">❆</div>
|
||||
<div class="snowflake">❅</div>
|
||||
<div class="snowflake">❆</div>
|
||||
</div>
|
||||
<div class="background">
|
||||
<h1>Calendrier de l'Avent 2024</h1>
|
||||
<h1>Calendrier de l'Avent 2025</h1>
|
||||
<div class="grid">
|
||||
<div class="box box-5" id="day-5">5</div>
|
||||
<div class="box box-17" id="day-17">17</div>
|
||||
@@ -40,8 +65,11 @@
|
||||
<div class="box box-16" id="day-16">16</div>
|
||||
<div class="box box-21" id="day-21">21</div>
|
||||
</div>
|
||||
<h2>Site réalisé par Appen pour le BDE de l’ISEN Nantes</h2>
|
||||
<footer class="footer">
|
||||
<p>🎄 Site réalisé par <span class="highlight">Appen</span> pour le BDE de l'ISEN Nantes 🎄</p>
|
||||
</footer>
|
||||
</div>
|
||||
<script src="static/script.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 809 KiB |
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user