Skip to content

Commit

Permalink
Add infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
ijpatricio committed May 31, 2023
1 parent 3d9f470 commit c52b1e1
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
vendor
.git
.idea

30 changes: 30 additions & 0 deletions docker/prod-ssu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM node:19 as static-assets
WORKDIR /app
COPY . .
RUN npm install
RUN npm run build

FROM serversideup/php:8.2-fpm-nginx
WORKDIR /var/www/html
ARG POSTGRES_VERSION=15
RUN apt-get update && apt-get install -y php-pgsql
RUN apt-get -y autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*

COPY composer.json composer.lock ./
RUN composer install --no-dev --no-interaction --no-plugins --no-scripts --prefer-dist

COPY --chown=9999:9999 . .
RUN composer dump-autoload

COPY --from=static-assets --chown=9999:9999 /app/public/build ./public/build
#COPY --chmod=755 docker/prod-ssu/etc/s6-overlay/ /etc/s6-overlay/

RUN php artisan route:cache
RUN php artisan view:cache

RUN echo "alias ll='ls -al'" >>/etc/bash.bashrc
RUN echo "alias a='php artisan'" >>/etc/bash.bashrc
RUN echo "alias mfs='php artisan migrate:fresh --seed'" >>/etc/bash.bashrc
RUN echo "alias cda='composer dump-autoload'" >>/etc/bash.bashrc
RUN echo "alias run='./scripts/run'" >>/etc/bash.bashrc
RUN echo "alias logs='tail -f storage/logs/laravel.log'" >>/etc/bash.bashrc
1 change: 1 addition & 0 deletions docker/prod-ssu/etc/s6-overlay/s6-rc.d/db-migration/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oneshot
2 changes: 2 additions & 0 deletions docker/prod-ssu/etc/s6-overlay/s6-rc.d/db-migration/up
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/command/execlineb -P
php /var/www/html/artisan migrate --force --isolated
Empty file.
4 changes: 4 additions & 0 deletions docker/prod-ssu/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Custom nginx configuration

# Disable access logs
access_log off;

0 comments on commit c52b1e1

Please sign in to comment.