chore: copy code files into images for Coolify & ignore local mounts

This commit is contained in:
Monarch055
2026-06-11 08:37:49 +07:00
parent bde5220db4
commit 7e373a28a1
5 changed files with 35 additions and 11 deletions
+10
View File
@@ -0,0 +1,10 @@
.git
.gitignore
docker-compose.override.yaml
docker-compose.override.yml
docker/
sistem-km-next/node_modules/
sistem-km-next/.next/
sistem-km-next/out/
*.sql
*.log
+5
View File
@@ -49,3 +49,8 @@ sistem-km-next/sistem-km-old
# general databases dumps
*.sql
# local docker compose override config
docker-compose.override.yaml
docker-compose.override.yml
+6 -8
View File
@@ -4,10 +4,10 @@ services:
# 1. PHP + Apache Web App (for Root Portal, SPBU, Parsil, and Chloropleth)
# Coolify's Traefik reverse proxy routes traffic to this service via the domain set in Coolify UI.
php-app:
build: ./docker/php
build:
context: .
dockerfile: ./docker/php/Dockerfile
container_name: gis_php_app
volumes:
- .:/var/www/html
environment:
- DB_HOST=db
- DB_DATABASE=spbu_db
@@ -21,13 +21,11 @@ services:
# 2. Next.js App Service
# Coolify's Traefik reverse proxy routes traffic to this service via the domain set in Coolify UI.
next-app:
build: ./docker/nextjs
build:
context: .
dockerfile: ./docker/nextjs/Dockerfile
container_name: gis_next_app
working_dir: /app
volumes:
- ./sistem-km-next:/app
- /app/node_modules # Anonymous volume to isolate node_modules from host machine
- /app/.next # Anonymous volume for nextjs build artifacts
environment:
- NEXT_PUBLIC_SUPABASE_URL=https://gzpvygrsfdtzykyqbnes.supabase.co
- NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imd6cHZ5Z3JzZmR0enlreXFibmVzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzkxNTUxNTIsImV4cCI6MjA5NDczMTE1Mn0.bP4qLY6PVT9UplSxB276tZ5HWClIkiuZ_-Yx3IlL8Dw
+11 -3
View File
@@ -5,12 +5,20 @@ RUN apk add --no-cache libc6-compat
WORKDIR /app
# Copy dependency files first
COPY sistem-km-next/package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application files
COPY sistem-km-next/ .
# Expose Next.js port
EXPOSE 3000
ENV PORT 3000
ENV HOSTNAME "0.0.0.0"
# Automatically install dependencies (to handle architecture differences between Windows host and Linux container)
# and run Next.js in development mode
CMD ["sh", "-c", "npm install && npm run dev"]
# Start Next.js app in development mode
CMD ["npm", "run", "dev"]
+3
View File
@@ -12,5 +12,8 @@ RUN echo "LimitRequestFieldSize 65536" >> /etc/apache2/apache2.conf
# Set working directory
WORKDIR /var/www/html
# Copy source files
COPY . /var/www/html/
# Expose port 80
EXPOSE 80