Skip to content

Commit

Permalink
Local development with docker compose, based on #401, closes #401
Browse files Browse the repository at this point in the history
  • Loading branch information
alcalbg committed Apr 18, 2024
1 parent ebc82d9 commit e195d19
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 2 deletions.
19 changes: 19 additions & 0 deletions Dockerfile.dev
@@ -0,0 +1,19 @@
FROM php:7-buster

RUN apt-get update > /dev/null
RUN apt-get install -y nodejs npm libzip-dev libgtk2.0-0 libgtk-3-0 libgbm-dev libldap2-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb

RUN docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/
RUN docker-php-ext-install zip ldap
RUN docker-php-ext-enable zip ldap

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

WORKDIR "/var/www/filegator/"

COPY . .
RUN composer install
RUN npm i
RUN cp -n configuration_sample.php configuration.php

CMD ["nohup", "bash", "-c", "npm run serve"]
14 changes: 13 additions & 1 deletion README.md
Expand Up @@ -110,6 +110,19 @@ Precompiled build is created for non-developers. In this version, the frontend (

[Download & install instructions](https://docs.filegator.io/install.html)

## Project setup for development (Docker)

```
git clone https://github.com/filegator/filegator.git
cd filegator
docker compose -f docker-compose-dev.yml up
```
Once everything is ready visit: `http://localhost:8080`, Ctrl+c to stop.

If you're tweaking dependencies then you must rebuild with:
```
docker compose -f docker-compose-dev.yml up --build
```

## Project setup for development (Linux)

Expand All @@ -126,7 +139,6 @@ npm install
npm run build
```


## Compiles and hot-reloads

The following command will launch backend and frontend on ports 8081 and 8080:
Expand Down
12 changes: 12 additions & 0 deletions docker-compose-dev.yml
@@ -0,0 +1,12 @@
services:
filegator:
build:
context: .
dockerfile: Dockerfile.dev
ports:
- "8080:8080" # frontend port, see package.json
- "8081:8081" # backend port, see package.json and .env.local
volumes:
- ./frontend:/var/www/filegator/frontend
- ./backend:/var/www/filegator/backend
#- ./configuration.php:/var/www/filegator/frontend/configuration.php
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "concurrently \"php -S localhost:8081\" \"vue-cli-service serve\"",
"serve": "concurrently \"php -S 0.0.0.0:8081\" \"vue-cli-service serve --port 8080\"",
"build": "vue-cli-service build --no-clean",
"test:unit": "vue-cli-service test:unit",
"test:e2e": "vue-cli-service test:e2e --headless",
Expand Down

0 comments on commit e195d19

Please sign in to comment.