Skip to content

Commit

Permalink
fix #33: add dockerfile and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
w3cj committed Feb 7, 2023
1 parent 6ac5215 commit 123cb72
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
EXPOSED_HTTP_PORT=8080
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM php:apache

RUN a2enmod rewrite

# Replace AllowOverride None with AllowOverride All in <Directory /var/www/> in /etc/apache2/apache2.conf
RUN sed -ri -e 'N;N;N;s/(<Directory \/var\/www\/>\n)(.*\n)(.*)AllowOverride None/\1\2\3AllowOverride All/;p;d;' /etc/apache2/apache2.conf

CMD [ "apachectl", "-D", "FOREGROUND" ]
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,23 @@ brew services start httpd

If you want me to advertise your instance (if you have opened your port, and have a fixed IP address or a domain name), please use below contacts.

## Run the API with Docker

1. Install [Docker](https://www.docker.com/).
2. Create a `.env` file and update it with your preferred port
```sh
cp .env.sample .env
```
3. Start the container with docker compose:
```sh
# start in the foreground
docker compose up
# start in the background
docker compose up -d
```
4.Verify that your API instance is reachable by trying to access:
- http://localhost:8080/ (update preferred port if not 8080)

## Contact:

- [Matrix](https://matrix.to/#/#youtube-operational-api:matrix.org)
Expand Down
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '3.8'
services:
api:
image: youtube-operational-api
build: .
restart: on-failure
volumes:
- ./:/var/www/html/
ports:
- ${EXPOSED_HTTP_PORT}:80

0 comments on commit 123cb72

Please sign in to comment.