Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: webifycms.com

volumes:
app-data:

networks:
webifycms-site:
driver: bridge
Expand All @@ -13,6 +16,8 @@ services:
dockerfile: ./docker/php/Dockerfile
env_file: .env
restart: always
volumes:
- app-data:/var/www/html
networks:
- webifycms-site

Expand All @@ -21,7 +26,7 @@ services:
container_name: ${APP_ID}-nginx
image: nginx:alpine
volumes:
- ./:/var/www/html
- app-data:/var/www/html:ro
- ./docker/nginx/nginx.caddy.conf:/etc/nginx/conf.d/default.conf
ports:
- "${NGINX_PORT}:80"
Expand Down
9 changes: 6 additions & 3 deletions docker/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,19 @@ COPY composer.* .
# install dependencies by allowing Docker to use the auth.json file of the host
RUN composer install --no-dev --no-autoloader --no-progress --no-interaction

# dump the autoloader
RUN composer dump-autoload --classmap-authoritative --no-dev

# copy application source
COPY --chown=app:app . .

# copy built frontend assets from stage 1
COPY --from=frontend --chown=app:app /build/public/assets/ ./public/assets/
COPY --from=frontend --chown=app:app /build/public/.vite/ ./public/.vite/

# copy images from source into public (not handled by Vite build)
COPY --chown=app:app assets/img/ ./public/assets/img/

# dump the autoloader (after source copy so classmap includes app classes)
RUN composer dump-autoload --classmap-authoritative --no-dev

# create non-root user
RUN addgroup -g 1000 -S app && adduser -u 1000 -S app -G app

Expand Down
4 changes: 2 additions & 2 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ fi
echo ">>> Pulling latest changes..."
git pull origin main

# Stop existing containers
# Stop existing containers and remove volumes for a clean build
echo ">>> Stopping existing containers..."
docker compose down
docker compose down -v

# Build new image (no cache for clean build)
echo ">>> Building Docker image..."
Expand Down
Loading