set up proper prod env

This commit is contained in:
Ben Goldsworthy 2024-02-18 12:16:12 +00:00
parent 35f00901e2
commit c9eada0388
8 changed files with 2683 additions and 1521 deletions

5
.gitignore vendored
View file

@ -7,6 +7,7 @@
/storage/*.key
/vendor
.env
.env.*
.env.backup
.phpunit.result.cache
Homestead.json
@ -17,3 +18,7 @@ yarn-error.log
/.idea
/.vscode
cron.out
/nginx
/development
docker-compose.yml

View file

@ -1,34 +0,0 @@
FROM php:8.1-fpm
# Arguments defined in docker-compose.yml
ARG user
ARG uid
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Install PHP extensions
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd
# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Create system user to run Composer and Artisan Commands
RUN useradd -G www-data,root -u $uid -d /home/$user $user
RUN mkdir -p /home/$user/.composer && \
chown -R $user:$user /home/$user
# Set working directory
WORKDIR /var/www
USER $user

2396
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,45 +0,0 @@
version: "3"
services:
app:
build:
args:
user: debian
uid: 1000
context: ./
dockerfile: Dockerfile
image: tracker
container_name: tracker-app
restart: unless-stopped
working_dir: /var/www/
environment:
NETWORK_ACCESS: internal
volumes:
- ./:/var/www
networks:
- tracker
webserver:
image: nginx
container_name: tracker-webserver
restart: unless-stopped
expose:
- 80
- 443
ports:
- "8000:80"
environment:
VIRTUAL_HOST: track.bengoldsworthy.net
LETSENCRYPT_HOST: track.bengoldsworthy.net
volumes:
- ./:/var/www
- ./nginx:/etc/nginx/conf.d
networks:
- tracker
- default
networks:
default:
external:
name: nginx-proxy
tracker:
driver: bridge

View file

@ -1,20 +0,0 @@
server {
listen 80;
index index.php index.html;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /var/www/public;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
gzip_static on;
}
}

1601
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -18,5 +18,6 @@
<script src="https://unpkg.com/leaflet@1.8.0/dist/leaflet.js"
integrity="sha512-BB3hKbKWOc9Ez/TAwyWxNXeoV9c1v6FIeYiBieIWkpLjauysF18NzgR1MBNBXf8/KABdlkX68nAhlwcDFLGPCQ=="
crossorigin=""></script>
<link rel="stylesheet" href="/css/app.css" />
@vite(['resources/css/app.css', 'resources/js/app.js'])
</head>