Skip to content

Commit

Permalink
Dockerizing the project
Browse files Browse the repository at this point in the history
  • Loading branch information
erfanmola committed Oct 8, 2023
1 parent 5d6d50a commit e386190
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
vendor
11 changes: 11 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM openswoole/swoole:latest-alpine

WORKDIR /var/www

COPY . /var/www

RUN composer install --working-dir=/var/www

EXPOSE ${OPENSWOOLE_SERVER_PORT}

CMD [ "php", "server.php" ]
2 changes: 1 addition & 1 deletion backend/server.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Load .env file configurations using vlucas/phpdotenv library
// and make them accessible via $_ENV
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->load();
$dotenv->safeLoad();

// Initialize a new OpenSwoole HTTP Server using the "OPENSWOOLE_SERVER_HOST"
// and "OPENSWOOLE_SERVER_PORT" variables from the .env file
Expand Down

0 comments on commit e386190

Please sign in to comment.