Skip to content

Commit

Permalink
update dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
r1chard-lyu committed Jun 7, 2023
1 parent 14130f1 commit 0d5e608
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM php:8.2.4-cli

WORKDIR /app

COPY . .
RUN apt-get update && \
apt-get install -y php-mysqli
RUN docker-php-ext-install mysqli

WORKDIR /app/All_Together
EXPOSE 8099

CMD php -S 140.113.216.24:8099
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker build --rm -t all_together .
38 changes: 38 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
version: '3'

services:
php:
container_name: php
image: all_together:latest
restart: always
depends_on:
- db
network_mode: "host"
volumes:
- ./src:/var/www/html

db:
container_name: mysql-db
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8 --collation-server=utf8_unicode_ci
image: mysql:8.0.32
#network_mode: "host"
ports:
- 3306:3306
volumes:
- db:/var/lib/mysql
- ./sqls:/docker-entrypoint-initdb.d
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
restart: always
environment:
MYSQL_ROOT_PASSWORD: zhon
MYSQL_DATABASE: allTogether
MYSQL_USER: cloud
MYSQL_PASSWORD: password
volumes:
db:
driver: local
driver_opts:
o: bind
type: none
device: /D/code/cloud/db

0 comments on commit 0d5e608

Please sign in to comment.