first commit
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
TZ=Asia/Tehran
|
||||
|
||||
APP_DOCKER_NETWORK=app
|
||||
|
||||
POSTGRES_IMAGE=postgres:latest
|
||||
POSTGRES_CONTAINER_NAME=postgres
|
||||
POSTGRES_HOSTNAME=postgres
|
||||
POSTGRES_USER=root
|
||||
POSTGRES_PASSWORD=password
|
||||
POSTGRES_DATABASE=app
|
||||
|
||||
REDIS_IMAGE=redis:alpine
|
||||
REDIS_CONTAINER_NAME=redis
|
||||
REDIS_HOSTNAME=redis
|
||||
REDIS_PASSWORD=password
|
||||
|
||||
PGADMIN_IMAGE=dpage/pgadmin4
|
||||
PGADMIN_CONTAINER_NAME=pgadmin
|
||||
PGADMIN_HOSTNAME=pgadmin
|
||||
PGADMIN_DEFAULT_EMAIL=admin@codespaces.ir
|
||||
PGADMIN_DEFAULT_PASSWORD=password
|
||||
@@ -0,0 +1 @@
|
||||
/storage
|
||||
@@ -0,0 +1,75 @@
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: ../
|
||||
dockerfile: Dockerfile
|
||||
image: api
|
||||
ports:
|
||||
- "8000:80"
|
||||
container_name: api
|
||||
user: 'root:root'
|
||||
restart: unless-stopped
|
||||
tty: true
|
||||
volumes:
|
||||
- ../storage:/app/storage
|
||||
redis:
|
||||
image: "${REDIS_IMAGE}"
|
||||
container_name: "${REDIS_CONTAINER_NAME}"
|
||||
hostname: "${REDIS_HOSTNAME}"
|
||||
restart: always
|
||||
command: redis-server --requirepass "${REDIS_PASSWORD}"
|
||||
environment:
|
||||
TZ: "${TZ}"
|
||||
volumes:
|
||||
- ./storage/redis:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
retries: 3
|
||||
timeout: 5s
|
||||
user: 'root:root'
|
||||
postgres:
|
||||
image: "${POSTGRES_IMAGE}"
|
||||
container_name: "${POSTGRES_CONTAINER_NAME}"
|
||||
hostname: "${POSTGRES_HOSTNAME}"
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: "${POSTGRES_DATABASE}"
|
||||
PGPASSWORD: "${POSTGRES_PASSWORD:-secret}"
|
||||
TZ: "${TZ}"
|
||||
volumes:
|
||||
- ./storage/postgres:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test:
|
||||
[
|
||||
"CMD",
|
||||
"pg_isready",
|
||||
"-q",
|
||||
"-d",
|
||||
"${POSTGRES_DATABASE}",
|
||||
"-U",
|
||||
"${POSTGRES_USER}",
|
||||
]
|
||||
retries: 3
|
||||
timeout: 5s
|
||||
user: 'root:root'
|
||||
pgadmin:
|
||||
image: "${PGADMIN_IMAGE}"
|
||||
container_name: "${PGADMIN_CONTAINER_NAME}"
|
||||
hostname: "${PGADMIN_HOSTNAME}"
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
TZ: "${TZ}"
|
||||
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org}
|
||||
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
|
||||
volumes:
|
||||
- ./storage/pgadmin:/var/lib/pgadmin
|
||||
ports:
|
||||
- 5050:80
|
||||
user: 'root:root'
|
||||
|
||||
networks:
|
||||
default:
|
||||
external: true
|
||||
name: '${APP_DOCKER_NETWORK}'
|
||||
@@ -0,0 +1,6 @@
|
||||
docker network create app
|
||||
cd deploy
|
||||
docker compose up -d
|
||||
docker exec -it api php artisan migrate --force
|
||||
docker exec -it api php artisan key:generate --force
|
||||
docker exec -it api php artisan optimize
|
||||
Reference in New Issue
Block a user