Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major v3.0.0 release #194

Merged
merged 193 commits into from
Oct 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
193 commits
Select commit Hold shift + click to select a range
6a68f58
Add new schema
karlomikus Aug 16, 2023
c6f134c
Add models
karlomikus Aug 18, 2023
d765b32
Add more logic
karlomikus Aug 18, 2023
815c4e0
Add bar context
karlomikus Aug 18, 2023
ca1bdbb
Add bar context to ingredients
karlomikus Aug 18, 2023
a739839
Move class
karlomikus Aug 19, 2023
98003ea
Move ingredients to bar references
karlomikus Aug 19, 2023
22fe350
Add bar context to ingredient categories
karlomikus Aug 19, 2023
cbc5c7f
Update shopping list and shelf user references
karlomikus Aug 20, 2023
e782f80
Housekeeping
karlomikus Aug 20, 2023
f1eb1f4
Update profile schema
karlomikus Aug 20, 2023
46f0556
Rename method
karlomikus Aug 20, 2023
cf1e798
Cache bar calls
karlomikus Aug 20, 2023
e54d620
Add more bar refs
karlomikus Aug 20, 2023
a55d60a
Update cocktail importing
karlomikus Aug 21, 2023
87f02f9
Add more logic to bar open
karlomikus Aug 21, 2023
1373af7
Simplify searchable data
karlomikus Aug 21, 2023
225d0cc
Save ing images
karlomikus Aug 21, 2023
ecf24a9
Resize base ingredient images
karlomikus Aug 21, 2023
6730e98
Optimize via pngquant
karlomikus Aug 21, 2023
7a66672
Optimize images via oxipng
karlomikus Aug 21, 2023
14a81b5
Split images into bar directories
karlomikus Aug 21, 2023
905cc1e
Improve ingredient import perf
karlomikus Aug 21, 2023
b64a69f
Optimize cocktail images
karlomikus Aug 21, 2023
9b7c12e
Fix path saving
karlomikus Aug 21, 2023
edac463
Handle tenant search keys
karlomikus Aug 22, 2023
24f5537
Add new migration for v3
karlomikus Aug 22, 2023
e1d6710
Combine migrations
karlomikus Aug 22, 2023
a829c5e
Fix collection bar refs
karlomikus Aug 22, 2023
4e2ba4b
Constrain cocktail methods
karlomikus Aug 22, 2023
0fc2b9d
Filter by bar more controllers
karlomikus Aug 24, 2023
d1ad24a
Add token resource
karlomikus Aug 24, 2023
e6a2e1d
Further optimize base ingredient import
karlomikus Aug 24, 2023
82c8e23
Update cocktail base import
karlomikus Aug 24, 2023
ef89156
Update base cocktail list
karlomikus Aug 24, 2023
116d38e
Rename service
karlomikus Aug 24, 2023
27d18ce
Add more bar endpoints
karlomikus Aug 25, 2023
9a89015
Update images endpoints
karlomikus Aug 25, 2023
2fea799
Update ingredient endpoints
karlomikus Aug 25, 2023
162f396
Update cocktails endpoints
karlomikus Aug 25, 2023
bdf2ae6
Update bar setup
karlomikus Aug 25, 2023
395dfd5
Add favorites endpoint
karlomikus Aug 25, 2023
63a8147
Clear cache on edit
karlomikus Aug 25, 2023
c2b57b6
Fix users endpoint authorization
karlomikus Aug 25, 2023
1a8d86f
Update changelog
karlomikus Aug 25, 2023
41de521
Rename created and updated user cols
karlomikus Aug 26, 2023
d62c6bc
Move traits
karlomikus Aug 26, 2023
f857251
Add more author refs
karlomikus Aug 27, 2023
76c2c13
Add missing base data
karlomikus Aug 27, 2023
49ffdf4
Fix filepaths
karlomikus Aug 27, 2023
b7619cb
Add more auth tests
karlomikus Aug 27, 2023
9c9eae5
Update cocktail tests
karlomikus Aug 27, 2023
242fb3b
Update tests
karlomikus Aug 27, 2023
926ea3d
Update bar testcase
karlomikus Aug 27, 2023
4112f28
Update cocktail method tests
karlomikus Aug 27, 2023
bed40e1
Update collection tests
karlomikus Aug 27, 2023
26c9636
Update glasses tests
karlomikus Aug 27, 2023
f1e11e4
Update image tests
karlomikus Aug 27, 2023
c8408a0
Update import tests
karlomikus Aug 27, 2023
a0f161e
Update cat tests
karlomikus Aug 27, 2023
a01ffcf
Update ingredient tests
karlomikus Aug 27, 2023
08ecc5b
Add a list of user notes
karlomikus Aug 28, 2023
76a99e1
Remove notes from cocktailresource
karlomikus Aug 28, 2023
7c3009d
Fix feature tests
karlomikus Aug 28, 2023
ecb81d6
Remove custom bar context in tests
karlomikus Aug 28, 2023
d3cb8fd
Fix static errors
karlomikus Aug 28, 2023
0c18674
Remove unused imports
karlomikus Aug 28, 2023
8b6c34b
Update spec
karlomikus Aug 28, 2023
4784b9d
Remove unused
karlomikus Aug 28, 2023
4ab14c9
Add invite toggling
karlomikus Aug 28, 2023
ae34651
Remove related notes
karlomikus Aug 29, 2023
5c8f8a5
Add public at field
karlomikus Aug 29, 2023
27ddd80
Add join bar endpoint
karlomikus Aug 29, 2023
b4452b8
Add missing request validation
karlomikus Aug 29, 2023
c4a12f8
Check for admin role instead of owner
karlomikus Aug 29, 2023
7d17eb5
Remove unused
karlomikus Aug 29, 2023
c073f25
Fix null check
karlomikus Aug 29, 2023
c5df57e
phpcs
karlomikus Aug 29, 2023
745713e
Add bar leave endpoint
karlomikus Aug 31, 2023
d370547
Add policy
karlomikus Aug 31, 2023
a90459b
Make models searchable
karlomikus Aug 31, 2023
8aaa80d
Just show the message
karlomikus Aug 31, 2023
cb4e97d
Save role updates
karlomikus Aug 31, 2023
18f4a87
Add access information
karlomikus Aug 31, 2023
d10385c
Optimize calls
karlomikus Aug 31, 2023
f736472
Remove collections array
karlomikus Aug 31, 2023
4bf5deb
Add migrator class
karlomikus Sep 1, 2023
582f02e
Migrate notes and ratings
karlomikus Sep 2, 2023
7abeb30
Update v3 schema
karlomikus Sep 2, 2023
badb1a8
Update index
karlomikus Sep 3, 2023
313f675
Update database name
karlomikus Sep 4, 2023
81226a0
Fix image policy
karlomikus Sep 4, 2023
db60893
Update import and export logic
karlomikus Sep 4, 2023
4ba8d81
update rating response
karlomikus Sep 4, 2023
4ff1ebf
Housekeeping
karlomikus Sep 4, 2023
bd9edc8
Fix bar opening
karlomikus Sep 4, 2023
5b5352a
Extract method
karlomikus Sep 4, 2023
2beef43
Update policy for user delete
karlomikus Sep 4, 2023
c20e20f
Clean bar images after delete
karlomikus Sep 4, 2023
faff18b
Add remove user from bar endpoint
karlomikus Sep 4, 2023
7af6118
Handle bar options
karlomikus Sep 5, 2023
64bc95a
Update docker run to support other db engines
karlomikus Sep 5, 2023
d0bd10e
Add puid, pgid
karlomikus Sep 5, 2023
7ffb214
Update schema
karlomikus Sep 6, 2023
1bdbb47
Remove base cocktail
karlomikus Sep 6, 2023
13c003f
Update base cocktail
karlomikus Sep 6, 2023
cfffa36
Update logic for setting meilisearch api key
karlomikus Sep 6, 2023
c44b6ec
Update last word image
karlomikus Sep 7, 2023
19cc028
Fix error message
karlomikus Sep 7, 2023
6941fe7
Remove user refs
karlomikus Sep 7, 2023
402517f
Ingredient category id is not required anymore
karlomikus Sep 7, 2023
60967ce
Remove unused
karlomikus Sep 7, 2023
7a05fa4
Housekeeping
karlomikus Sep 7, 2023
603d232
Update policies
karlomikus Sep 7, 2023
0cd3123
Update user handling
karlomikus Sep 9, 2023
6a7abce
Update dockerfile
karlomikus Sep 9, 2023
492d5a5
Fix search sync
karlomikus Sep 9, 2023
f57afec
Remove unused
karlomikus Sep 9, 2023
8670bc7
Update deps
karlomikus Sep 10, 2023
2ed5d0a
Add better puid and pgid handling
karlomikus Sep 10, 2023
8d8ec63
Use multistage build with target for images
karlomikus Sep 10, 2023
574767d
Unused image
karlomikus Sep 10, 2023
fba6a32
Enable queue container
karlomikus Sep 10, 2023
c65e478
Update commands
karlomikus Sep 10, 2023
6263aa6
Make backups folder
karlomikus Sep 10, 2023
ec276a2
Update backup path
karlomikus Sep 10, 2023
b2ba43d
Add import duplicate handling
karlomikus Sep 13, 2023
3c57019
Update spec
karlomikus Sep 13, 2023
578d38c
Add amount max to cocktail ingredient
karlomikus Sep 13, 2023
b62bfc3
Add cocktail ingredient notes
karlomikus Sep 17, 2023
75033ad
Add migrate script
karlomikus Sep 21, 2023
404163a
Add missing col
karlomikus Sep 21, 2023
147e0a9
Remove unique
karlomikus Sep 21, 2023
c46efaa
Migrate substitutes
karlomikus Sep 21, 2023
dd02726
Fix missing id
karlomikus Sep 21, 2023
a541ad4
Make active on migrate
karlomikus Sep 21, 2023
371fc99
Update deps
karlomikus Sep 21, 2023
6e5a5a9
Merge remote-tracking branch 'origin/develop' into v3-dev
karlomikus Sep 21, 2023
2ff73bf
Merge pull request #163 from karlomikus/v3-dev
karlomikus Sep 21, 2023
d08de91
Update tests
karlomikus Sep 21, 2023
9874e8e
Update specs
karlomikus Sep 21, 2023
d5fda87
Use docker meta action
karlomikus Sep 24, 2023
7cc8485
Add more ingredient tests
karlomikus Sep 24, 2023
1aec546
Update params
karlomikus Sep 24, 2023
344678a
Remove command
karlomikus Sep 24, 2023
fd1b855
Update import tests
karlomikus Sep 24, 2023
651ff70
Move tests
karlomikus Sep 24, 2023
2565146
Update substitute importing
karlomikus Sep 24, 2023
d0b853a
Add return types
karlomikus Sep 24, 2023
ae88bdd
Update array import tests
karlomikus Sep 24, 2023
9fea505
Bump meilisearch/meilisearch-php from 1.3.0 to 1.4.0
dependabot[bot] Sep 25, 2023
b36d88b
Bump doctrine/dbal from 3.6.6 to 3.6.7
dependabot[bot] Sep 25, 2023
760bd43
Merge pull request #192 from karlomikus/dependabot/composer/develop/d…
karlomikus Sep 25, 2023
0f4b171
Merge pull request #191 from karlomikus/dependabot/composer/develop/m…
karlomikus Sep 26, 2023
2cc0056
Add access attributes
karlomikus Sep 26, 2023
f919e41
Update changelog
karlomikus Sep 26, 2023
92e84b2
Update method policy
karlomikus Sep 26, 2023
63bfab5
Merge branch 'develop' of github.com:karlomikus/bar-assistant into de…
karlomikus Sep 26, 2023
72cfd99
Update deps
karlomikus Sep 26, 2023
c292e60
Remove unused
karlomikus Sep 26, 2023
78a4fc2
Update import controller test
karlomikus Sep 28, 2023
576aa69
Backup files before migration
karlomikus Sep 28, 2023
760076f
Fix namespace
karlomikus Sep 28, 2023
9ddf1d0
Ignore errors on mkdir
karlomikus Sep 28, 2023
05d2ea1
Fix zip filepath
karlomikus Sep 28, 2023
bc7205b
Remove api key saving
karlomikus Sep 28, 2023
e7f1d4b
Rename api key name
karlomikus Sep 28, 2023
d69dcf2
Add user check
karlomikus Sep 30, 2023
388d16c
Add test
karlomikus Sep 30, 2023
71d6743
Add new fields to share array
karlomikus Oct 1, 2023
6000c29
Add collection tests
karlomikus Oct 1, 2023
83d9bc8
Update spec
karlomikus Oct 1, 2023
85c3cf5
Add role check
karlomikus Oct 1, 2023
6b6d9f7
Remove env var
karlomikus Oct 1, 2023
3c6a712
Update test
karlomikus Oct 1, 2023
1903b3d
Update deps
karlomikus Oct 1, 2023
d7fb7bc
Update shoppinglist schema
karlomikus Oct 1, 2023
63d08f8
Add notes spec
karlomikus Oct 1, 2023
3498c33
Update stats schema
karlomikus Oct 1, 2023
53d4786
Update import schema
karlomikus Oct 1, 2023
d3dde6f
Fix missing parameter
karlomikus Oct 1, 2023
8d3661b
Bump spatie/laravel-responsecache from 7.4.8 to 7.4.9
dependabot[bot] Oct 2, 2023
a856e50
Bump laravel/scout from 9.8.1 to 10.4.0
dependabot[bot] Oct 2, 2023
fe2fe76
Update bar request
karlomikus Oct 2, 2023
034cb54
Add user shelf sharing
karlomikus Oct 2, 2023
1f3b90f
Merge pull request #196 from karlomikus/dependabot/composer/develop/s…
karlomikus Oct 2, 2023
5eb2805
Merge pull request #197 from karlomikus/dependabot/composer/develop/l…
karlomikus Oct 2, 2023
7e12a73
Fix namespaces
karlomikus Oct 2, 2023
f6908df
Add full backup command
karlomikus Oct 2, 2023
a66f344
Fix amount handling
karlomikus Oct 4, 2023
82e3075
Update tests
karlomikus Oct 4, 2023
763cf65
Add more base cocktails
karlomikus Oct 5, 2023
2c38246
Temp disable latest tag
karlomikus Oct 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 10 additions & 10 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/vendor
/node_modules
/.vscode
/public/build
/public/hot
/public/storage
/public/app_images
/storage/*.key
/database/database.sqlite
/storage/database.sqlite
vendor
node_modules
.vscode
.github
public/storage
public/uploads
storage/logs/*
storage/http_cache/*
storage/debugbar/*
storage/bar-assistant
.env

Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ REDIS_PORT=6379
SCOUT_DRIVER=meilisearch
MEILISEARCH_HOST=
MEILISEARCH_KEY=
MEILISEARCH_API_KEY=

SANCTUM_STATEFUL_DOMAINS=

#DISABLE_LOGIN=true
PARENT_INGREDIENT_SUBSTITUTE=false
1 change: 1 addition & 0 deletions .github/workflows/build-dev-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
uses: docker/build-push-action@v3
with:
context: .
target: dist
platforms: linux/amd64
push: true
tags: barassistant/server:dev
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ jobs:
-
name: Checkout
uses: actions/checkout@v3
-
name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
barassistant/server
flavor: |
latest=false
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern=v{{major}}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand All @@ -29,9 +42,10 @@ jobs:
uses: docker/build-push-action@v3
with:
context: .
target: dist
platforms: linux/amd64,linux/arm64
push: true
tags: barassistant/server:latest, barassistant/server:${{github.ref_name}}
tags: ${{ steps.meta.outputs.tags }}
build-args: BAR_ASSISTANT_VERSION=${{github.ref_name}}
cache-from: type=gha
cache-to: type=gha,mode=max
36 changes: 0 additions & 36 deletions .github/workflows/build-kmikus12-image.yml

This file was deleted.

82 changes: 82 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,82 @@
# v3.0.0
## Multiple bars
- Bar Assistant now supports multiple bars.
- With this change a lot of endpoints now require to have bar reference, this comes in a form of `bar_id` query parameter
- Please refer to the new schema specification to see what endpoints now require `bar_id` query parameter
- This update also changed a lot database table schemas, so I advise you to create a backup of your data before you update to v3
- Users can be invited or join with invite code to specific bars

## Improved user control
- Users can have one of the following roles in a bar:
- Guest
- Rate and favorite cocktails
- Create personal collections
- General
- Everything as "Guest"
- Can add cocktails and ingredients
- Moderator
- Everything as "General"
- Can not modify bar
- Can not change user roles
- Admin
- Everything as "Moderator"
- Full access to all bar actions

## Breaking changes
- Updated a lot of schemas, refer to openapi specification to see the changes
- Token response is now wrapped with `data` object like the rest of the endpoints endpoint
- Removed POST `shelf/ingredients` endpoint
- Removed POST `shelf/ingredients/{ingredientId}` endpoint
- **Upgrade guide**: Use `shelf/ingredients/batch-store` endpoint
- Removed DELETE `shelf/ingredients/{ingredientId}` endpoint
- **Upgrade guide**: Use `shelf/ingredients/batch-delete` endpoint
- Removed `notes` property from `Cocktail` schema
- **Upgrade guide**: Use `notes/` endpoint to get users notes
- Removed `glasses/find` endpoint
- **Upgrade guide**: Use `glasses/` endpoint with `filter[name]` query string
- Removed GET `/images` endpoint
- Removed `bar:make-admin` command
- Removed `bar:open` command
- Removed `bar:refresh-user-search-keys` command
- Removed `bar:import-zip` command
- Removed `bar:export-zip` command
- Removed `bar:scrape` command
- Renamed `/user` endpoint to `/profile`
- Renamed `user_id` filter on `cocktails` endpoint to `created_user_id`
- Renamed `user_id` filter on `ingredients` endpoint to `created_user_id`
- Ingredient category is not required anymore when adding an ingredient

## New
- Added `bars/` endpoint
- Added GET `notes/` endpoint
- Stats now have users top 5 favorite ingredients, calculated from favorite cocktails
- Importing cocktails from collection now has actions on how to handle duplicates
- Added `bar:backup {barId}` command
- Cocktail ingredient now supports variable amounts, you can add max amount with `amount_max` attribute
- Cocktail ingredient now can have a note attached
- Cocktail substitutes now have the following attributes: `ingredient_id`, `amount`, `amount_max`, `units`
- Added options on how to handle duplicated recipes when importing collection
- Duplicates are matched by recipe name
- Possible actions:
- Do nothing
- Overwrite duplicated
- Skip duplicates
- Added `average_rating_min` filter to `cocktails` endpoint
- Added `average_rating_max` filter to `cocktails` endpoint

## Changes
- Default database filename changed to `database.ba3.sqlite`
- Optimized base images of cocktails and ingredients
- Cocktail and ingredient images are now categorized in folders by bar id
- Merged all migrations to a single one
- Meilisearch API keys are now generating tenant tokens
- Changed the way slugs are generated, they now include bar id
- Changed what attributes are searchable
- Removed from `cocktails` index: `garnish`, `image_hash`, `main_image_id`, `user_id`, `glass`, `average_rating`, `main_ingredient_name`, `calculated_abv`, `method`, `has_public_link`
- Added to `cocktails` index: `bar_id`
- Removed from `ingredients` index: `strength_abv`, `color`
- Added to `ingredients` index: `bar_id`

# v2.6.0
## New
- Added export options for version 3: `php artisan bar:export-zip --version3`
Expand Down Expand Up @@ -155,6 +234,7 @@
- Updated `UserIngredient` schema
- Updated `Ingredient` schema
- Moved `parent_ingredient_id` to `parent_ingredient` object, accessible via `parent_ingredient.id`
- Removed `DISABLE_LOGIN` env variable

## New
- Meilisearch is no longer mandatory dependency for API to work
Expand All @@ -165,6 +245,8 @@
- This will remove the need to authenticate with token to access the api
- Added GET `/images` endpoint
- `ImageRequest` schema now supports `image_url` parameter to upload image from URL
- Added `MAX_USER_BARS` env variable, defaults to 50
- This limits how many bars can a single user create

## Fixes
- Fixed openapi swagger docs url
Expand Down
69 changes: 41 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
FROM php:8.2-fpm
FROM php:8.2-fpm as php-base

ARG BAR_ASSISTANT_VERSION
ENV BAR_ASSISTANT_VERSION=${BAR_ASSISTANT_VERSION:-v0-dev}
ENV BAR_ASSISTANT_VERSION=${BAR_ASSISTANT_VERSION:-develop}

ARG PGID=1000
ENV PGID=${PGID}
ARG PUID=1000
ENV PUID=${PUID}

# Add php extension manager
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

# Add dependencies
RUN apt update \
&& apt-get install -y \
git \
Expand All @@ -13,45 +20,51 @@ RUN apt update \
nginx \
gosu \
&& apt-get autoremove -y \
&& apt-get clean

ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod +x /usr/local/bin/install-php-extensions && \
install-php-extensions imagick opcache redis zip

# Setup custom php config
COPY ./resources/docker/php.ini $PHP_INI_DIR/php.ini

# Setup nginx
COPY ./resources/docker/nginx.conf /etc/nginx/sites-enabled/default
RUN echo "access.log = /dev/null" >> /usr/local/etc/php-fpm.d/www.conf

# Add container entrypoint script
COPY ./resources/docker/entrypoint.sh /usr/local/bin/entrypoint
RUN chmod +x /usr/local/bin/entrypoint
&& apt-get clean \
&& chmod +x /usr/local/bin/install-php-extensions && \
install-php-extensions imagick opcache redis zip && \
echo "access.log = /dev/null" >> /usr/local/etc/php-fpm.d/www.conf

# Add composer
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer

USER www-data:www-data
FROM php-base as dist

WORKDIR /var/www/cocktails

COPY --chown=www-data:www-data . .
COPY . .

RUN sed -i "s/{{VERSION}}/$BAR_ASSISTANT_VERSION/g" ./docs/open-api-spec.yml
# Configure nginx
COPY ./resources/docker/nginx.conf /etc/nginx/sites-enabled/default

RUN chmod +x /var/www/cocktails/resources/docker/run.sh
# Configure php
COPY ./resources/docker/php.ini $PHP_INI_DIR/php.ini

RUN composer install --optimize-autoloader --no-dev
# Add container entrypoint script
COPY ./resources/docker/entrypoint.sh /usr/local/bin/entrypoint

RUN mkdir -p /var/www/cocktails/storage/bar-assistant/
RUN chmod +x /usr/local/bin/entrypoint \
&& chmod +x /var/www/cocktails/resources/docker/run.sh \
&& sed -i "s/{{VERSION}}/$BAR_ASSISTANT_VERSION/g" ./docs/open-api-spec.yml \
&& composer install --optimize-autoloader --no-dev \
&& mkdir -p /var/www/cocktails/storage/bar-assistant/

EXPOSE 3000

VOLUME ["/var/www/cocktails/storage/bar-assistant"]

USER root:root

ENTRYPOINT ["entrypoint"]
CMD ["/bin/bash", "-c", "php-fpm & nginx -g 'daemon off;'"]

FROM php-base as localdev

RUN useradd -G www-data,root -u $PUID -d /home/developer developer
RUN mkdir -p /home/developer/.composer && \
chown -R developer:developer /home/developer

USER developer

WORKDIR /var/www/cocktails

EXPOSE 9000

CMD ["php-fpm"]
35 changes: 0 additions & 35 deletions Dockerfile.dev

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ This repository only contains the API server, if you are looking for easy to use
## Features
- Includes all current IBA cocktails
- Over 100 ingredients
- Add and manage multiple bars
- Fine grained control with user roles
- Endpoints for managing of ingredients and cocktails
- Mark ingredients you have and get all cocktails that you can make
- Detailed cocktail and ingredient information
Expand Down Expand Up @@ -61,7 +63,6 @@ $ docker compose exec app composer install
$ docker compose exec app php artisan key:generate
$ docker compose exec app php artisan storage:link
$ docker compose exec app php artisan migrate
$ docker compose exec app php artisan bar:open
```

Xdebug vscode launch config:
Expand Down
19 changes: 19 additions & 0 deletions app/BarContext.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

namespace Kami\Cocktail;

use Kami\Cocktail\Models\Bar;

class BarContext
{
public function __construct(private readonly Bar $currentBar)
{
}

public function getBar(): Bar
{
return $this->currentBar;
}
}
Loading