0% found this document useful (0 votes)
21 views4 pages

Modul Instalasi Docker

modul instalasi docker

Uploaded by

nidanur1904
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views4 pages

Modul Instalasi Docker

modul instalasi docker

Uploaded by

nidanur1904
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Jobsheet docker

1. Siapkan VM ubuntu

2. Install docker
a) Sudo apt update -y
b) sudo apt install docker.io -y
c) sudo apt install docker -y
d) docker - -version

3. install docker compose


a) sudo apt install docker-compose
b) docker-compose - -version

4. install composer
a) sudo apt install composer -y
b) composer - -version

5. masukkan folder projek


a) bisa pakai github
- git clone https://github.com/xxx/xxx.git lsp
- cd lsp
b) bisa pakai flashdisk/mount

6. masuk folder projek example: cd lsp


a) nano .env
b) nano Dockerfile
c) mkdir -p docker-compose/nginx
d) nano docker-compose/nginx/lsp.conf
e) mkdir docker/nginx
f) cd docker/nginx
g) nano nginx.conf
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_sc>
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
gzip_static on;
}
}

h) cd ..
i) nano entrypoint.sh

#!/bin/bash

if [ ! -f "vendor/autoload.php" ]; then
composer install --no-progress --no-interaction
fi

if [ ! -f ".env" ]; then
echo "Creating .env file for env local"
cp .env.example .env
else
echo "Using existing .env file"
fi
php artisan key:generate
php artisan migrate --force
php artisan cache:clear
php artisan optimize
# php artisan config:clear
# php artisan route:clear

php artisan serve --port=80 --host=0.0.0.0 --env=.env


exec docker-php-entrypoint "$@"

j) nano docker-compose.yml

version: "3.8"

services:
php:
build:
context: .
dockerfile: Dockerfile
target: php
args:
- APP_ENV=local
environment:
- APP_ENV=local
- CONTAINER_ROLE=app
working_dir: /var/www
volumes:
- .:/var/www
ports:
- "80:8000"
- "8001:80"
depends_on:
- database
database:
image: mysql:latest
container_name: mysql
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: apotik
MYSQL_USER: root
MYSQL_PASSWORD:
MYSQL_ROOT_PASSWORD:
volumes:
- ./docker/mysql:/var/lib/mysql
volumes:
db-data: {}

7. running app
sudo docker-compose build app
sudo docker-compose up -d
sudo composer install --ignore-platform-reqs --no-scripts
sudo composer update --ignore-platform-reqs --no-scripts
sudo docker-compose exec app php artisan migrate:fresh

8. search ip docker:8000

cek UID : cat /etc/passwd

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy