Compare commits
1 Commits
main
...
production
| Author | SHA1 | Date | |
|---|---|---|---|
| 802e2185c4 |
17
.gitea/workflows/deploy.yml
Normal file
17
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
name: Deploy faithshort to production
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- production
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: docker
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Deploy with Docker Compose
|
||||||
|
run: |
|
||||||
|
docker compose up -d --build
|
||||||
18
Dockerfile
Normal file
18
Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
FROM ubuntu:latest
|
||||||
|
LABEL authors="KAKOU CYR LEONCE ANICET"
|
||||||
|
FROM node:22-alpine AS builder
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN npm install
|
||||||
|
COPY . .
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
FROM node:22-alpine
|
||||||
|
WORKDIR /app
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN npm install --omit=dev
|
||||||
|
COPY --from=builder /app/.next ./.next
|
||||||
|
COPY --from=builder /app/public ./public
|
||||||
|
EXPOSE 3000
|
||||||
|
CMD ["npm", "run", "start"]
|
||||||
38
docker-compose.yml
Normal file
38
docker-compose.yml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
services:
|
||||||
|
faithshort:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
container_name: faithshort
|
||||||
|
environment:
|
||||||
|
NODE_ENV: production
|
||||||
|
DB_HOST: db_faithshort
|
||||||
|
DB_PORT: 5432
|
||||||
|
DB_NAME: faithshort_db
|
||||||
|
DB_USER: faithshort_user
|
||||||
|
DB_PASSWORD: h%%!m2B75hkr5Vh5bZ3V
|
||||||
|
networks:
|
||||||
|
- web
|
||||||
|
depends_on:
|
||||||
|
- db_faithshort
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
db_faithshort:
|
||||||
|
image: postgres:17
|
||||||
|
container_name: db_faithshort
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: faithshort_db
|
||||||
|
POSTGRES_USER: faithshort_user
|
||||||
|
POSTGRES_PASSWORD: h%%!m2B75hkr5Vh5bZ3V
|
||||||
|
volumes:
|
||||||
|
- faithshort_pgdata:/var/lib/postgresql/data
|
||||||
|
networks:
|
||||||
|
- web
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
networks:
|
||||||
|
web:
|
||||||
|
external: true
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
faithshort_pgdata:
|
||||||
Reference in New Issue
Block a user