This commit is contained in:
parent
e573024187
commit
a0e4d91068
@ -22,7 +22,7 @@ steps:
|
|||||||
- apk add --no-cache curl bash
|
- apk add --no-cache curl bash
|
||||||
- echo "$REGISTRY_PASSWORD" | docker login -u "$REGISTRY_USERNAME" --password-stdin registry.git.appstaging.my.id
|
- echo "$REGISTRY_PASSWORD" | docker login -u "$REGISTRY_USERNAME" --password-stdin registry.git.appstaging.my.id
|
||||||
- docker buildx create --use --name mybuilder || true
|
- docker buildx create --use --name mybuilder || true
|
||||||
- docker buildx build --platform linux/arm64 linux/amd64 -t registry.git.appstaging.my.id/reihanrere/sistem-akademik/sistem-akademik-dev -f Dockerfile . --push
|
- docker buildx build --platform linux/arm64 -t registry.git.appstaging.my.id/reihanrere/sistem-akademik/sistem-akademik-dev -f Dockerfile . --push
|
||||||
|
|
||||||
- name: deploy-image-dev
|
- name: deploy-image-dev
|
||||||
image: debian:latest
|
image: debian:latest
|
||||||
|
|||||||
61
Dockerfile
61
Dockerfile
@ -1,36 +1,49 @@
|
|||||||
# Define the base image
|
FROM php:8.3-fpm
|
||||||
FROM teguh02/laravel-filament:latest
|
|
||||||
|
|
||||||
# Set user to root
|
# Install system dependencies & PHP extensions
|
||||||
USER root
|
RUN apt-get update && apt-get install -y \
|
||||||
|
libzip-dev \
|
||||||
|
unzip \
|
||||||
|
git \
|
||||||
|
libpq-dev \
|
||||||
|
libicu-dev \
|
||||||
|
zip \
|
||||||
|
curl \
|
||||||
|
&& docker-php-ext-install \
|
||||||
|
intl \
|
||||||
|
zip \
|
||||||
|
pdo_pgsql \
|
||||||
|
bcmath
|
||||||
|
|
||||||
# Change the working directory
|
# Install Composer
|
||||||
|
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
||||||
|
|
||||||
|
# Set working directory
|
||||||
WORKDIR /var/www
|
WORKDIR /var/www
|
||||||
|
|
||||||
# Remove the all files in the /var/www/html directory
|
# Copy source
|
||||||
RUN rm -rf /var/www/html/*
|
COPY . .
|
||||||
|
COPY .env.example .env
|
||||||
|
|
||||||
# Copy laravel public directory to the /var/www/html directory
|
# Set www-data user permission before running composer/install artisan
|
||||||
COPY ./public /var/www/html
|
RUN chown -R www-data:www-data /var/www
|
||||||
|
|
||||||
# Copy the project files to the /var/www directory
|
USER www-data
|
||||||
COPY . /var/www
|
|
||||||
|
|
||||||
# Install the project dependencies
|
# Install dependencies & generate app key as www-data user
|
||||||
RUN composer install
|
RUN composer install --no-interaction --prefer-dist --optimize-autoloader \
|
||||||
RUN npm install
|
&& php artisan key:generate
|
||||||
|
|
||||||
# Build the vite
|
USER root
|
||||||
RUN npm run build
|
|
||||||
|
# Set permissions again just in case
|
||||||
|
RUN chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache \
|
||||||
|
&& chmod -R 775 /var/www/storage /var/www/bootstrap/cache
|
||||||
|
|
||||||
# Change the directory permission
|
|
||||||
RUN chmod -R 777 /var/www
|
RUN chmod -R 777 /var/www
|
||||||
|
|
||||||
# If you want to change the timezone of the container to UTC
|
|
||||||
# RUN sed -i 's/;date.timezone =/date.timezone = UTC/g' /etc/php/8.3/fpm/php.ini
|
|
||||||
# RUN sed -i 's/;date.timezone =/date.timezone = UTC/g' /etc/php/8.3/cli/php.ini
|
|
||||||
|
|
||||||
# If you want to display the error message
|
|
||||||
RUN sed -i 's/display_errors = Off/display_errors = On/g' /etc/php/8.3/fpm/php.ini
|
RUN sed -i 's/display_errors = Off/display_errors = On/g' /etc/php/8.3/fpm/php.ini
|
||||||
RUN sed -i 's/display_errors = Off/display_errors = On/g' /etc/php/8.3/cli/php.ini
|
RUN sed -i 's/display_errors = Off/display_errors = On/g' /etc/php/8.3/cli/php.ini
|
||||||
RUN sed -i 's/error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT/error_reporting = E_ALL/g' /etc/php/8.3/fpm/php.ini
|
RUN sed -i 's/error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT/error_reporting = E_ALL/g' /etc/php/8.3/fpm/php.ini
|
||||||
|
|
||||||
|
EXPOSE 9000
|
||||||
|
CMD ["php-fpm"]
|
||||||
|
|||||||
@ -1,24 +1,40 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
sistem-akademik-dev:
|
sistem-akademik-dev:
|
||||||
|
build: .
|
||||||
container_name: sistem-akademik-dev
|
container_name: sistem-akademik-dev
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./public:/var/www/html
|
|
||||||
- .:/var/www
|
- .:/var/www
|
||||||
|
- ./storage:/var/www/storage
|
||||||
|
working_dir: /var/www
|
||||||
|
expose:
|
||||||
|
- 9000
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
APP_ENV: production
|
||||||
|
APP_DEBUG: false
|
||||||
|
APP_KEY: base64:Wz4daUZXYysRm1vUWBWTjQ5v0JFWBsQ2wPw2tHRALgY=
|
||||||
|
DB_CONNECTION: pgsql
|
||||||
|
DB_HOST: appstaging.my.id
|
||||||
|
DB_PORT: 5432
|
||||||
|
DB_DATABASE: SISKA_2025
|
||||||
|
DB_USERNAME: root
|
||||||
|
DB_PASSWORD: postroot123
|
||||||
|
networks:
|
||||||
|
- traefik_default
|
||||||
|
|
||||||
|
web:
|
||||||
|
image: nginx:alpine
|
||||||
|
container_name: sistem-akademik-dev-web
|
||||||
|
volumes:
|
||||||
|
- .:/var/www
|
||||||
|
- ./nginx:/etc/nginx/conf.d
|
||||||
ports:
|
ports:
|
||||||
- 7271:80
|
- 8282:80
|
||||||
restart: unless-stopped
|
depends_on:
|
||||||
extra_hosts:
|
- sistem-akademik-dev
|
||||||
- "host.docker.internal:host-gateway"
|
restart: always
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "curl", "-f", "http://localhost/up"]
|
|
||||||
interval: 30s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 5
|
|
||||||
env_file:
|
|
||||||
- .env
|
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.web-http.entrypoints=web"
|
- "traefik.http.routers.web-http.entrypoints=web"
|
||||||
@ -29,7 +45,7 @@ services:
|
|||||||
- "traefik.http.routers.web.rule=Host(`siska.appstaging.my.id`)"
|
- "traefik.http.routers.web.rule=Host(`siska.appstaging.my.id`)"
|
||||||
- 'traefik.http.routers.web.tls=true'
|
- 'traefik.http.routers.web.tls=true'
|
||||||
networks:
|
networks:
|
||||||
- traefik_default
|
- traefik_default
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
traefik_default:
|
traefik_default:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user