redone docker stuff

This commit is contained in:
pika 2024-06-20 22:14:33 +02:00
parent 249e5a7071
commit 5abd08bb5a
2 changed files with 13 additions and 34 deletions

View file

@ -1,18 +1,14 @@
# Use the official PHP image with Apache # Dockerfile
FROM php:8.1-apache FROM klakegg/hugo:0.83.1-ext-alpine
# Install necessary PHP extensions # Set working directory
RUN docker-php-ext-install pdo pdo_mysql WORKDIR /app
# Enable Apache mod_rewrite # Copy the site files
RUN a2enmod rewrite COPY . /app
# Set the working directory # Build the static site
WORKDIR /var/www/html RUN hugo
# Set permissions
RUN chown -R www-data:www-data /var/www/html
# Start Apache in the foreground
CMD ["apache2-foreground"]
# Serve the site
CMD ["hugo", "server", "--bind", "0.0.0.0"]

View file

@ -1,24 +1,7 @@
services: services:
web: blog-pika:
build: . build: .
ports: ports:
- "8088:80" - "1313:1313"
volumes: volumes:
- ./www/public:/var/www/html - ./www:/app
restart: unless-stopped
# depends_on:
# - db
# db:
# image: mysql:5.7
# restart: unless-stopped
# environment:
# MYSQL_ROOT_PASSWORD: rootpassword
# MYSQL_DATABASE: mydatabase
# MYSQL_USER: myuser
# MYSQL_PASSWORD: mypassword
# ports:
# - "3306:3306"
# volumes:
# - ./db_data:/var/lib/mysql