restauration fichier docker
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
node_modules
|
||||
.next
|
||||
.git
|
||||
.gitea
|
||||
*.log
|
||||
npm-debug.log*
|
||||
.env
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
dist
|
||||
build
|
||||
@@ -1,21 +0,0 @@
|
||||
FROM node:22-alpine
|
||||
RUN apk add --no-cache libc6-compat openssl
|
||||
WORKDIR /app
|
||||
ENV PATH /app/node_modules/.bin:$PATH
|
||||
|
||||
# On copie tout, on installe tout, on build tout au même endroit
|
||||
COPY . .
|
||||
RUN npm ci
|
||||
RUN npx prisma generate
|
||||
RUN npm run build
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
RUN addgroup --system --gid 1001 nodejs
|
||||
RUN adduser --system --uid 1001 nextjs
|
||||
RUN chown -R nextjs:nodejs /app
|
||||
|
||||
USER nextjs
|
||||
|
||||
# On lance directement via npm
|
||||
CMD ["npm", "start"]
|
||||
@@ -1,56 +0,0 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
db:
|
||||
image: postgres:15
|
||||
container_name: afrohub_db
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_USER: admin
|
||||
POSTGRES_PASSWORD: adminpassword
|
||||
POSTGRES_DB: afrohub_dev
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U admin -d afrohub_dev"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
app:
|
||||
image: git.home.arrondeau.fr/streaper2/afrov2:latest
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: afrohub_app
|
||||
restart: always
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
- DATABASE_URL=postgresql://admin:adminpassword@db:5432/afrohub_dev?schema=public
|
||||
- NEXT_PUBLIC_SITE_URL=http://localhost:3000
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
|
||||
admin:
|
||||
image: git.home.arrondeau.fr/streaper2/afrov2-admin:latest
|
||||
build:
|
||||
context: ./admin
|
||||
dockerfile: Dockerfile
|
||||
container_name: afrohub_admin
|
||||
restart: always
|
||||
ports:
|
||||
- "3001:3001"
|
||||
environment:
|
||||
- DATABASE_URL=postgresql://admin:adminpassword@db:5432/afrohub_dev?schema=public
|
||||
- NEXT_PUBLIC_SITE_URL=http://localhost:3000
|
||||
- NEXT_PUBLIC_ADMIN_URL=http://localhost:3001
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
Reference in New Issue
Block a user