-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from fykosak/dev-docker
docker base
- Loading branch information
Showing
18 changed files
with
293 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
parameters: | ||
# FKSDB API endpoint | ||
fksdbDownloader: | ||
login: | ||
password: | ||
url: | ||
gameApiURL: | ||
login: '' | ||
password: '' | ||
url: 'https://db.fykos.cz/api/' | ||
|
||
# game API endpoint, used for FOL/FOF live results | ||
#gameApi: | ||
# login: '' | ||
# password: '' | ||
# url: '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
log | ||
temp | ||
config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
FROM php:8.1-apache | ||
|
||
# install needed packages | ||
RUN apt update && apt install -y \ | ||
gettext \ | ||
libfreetype-dev \ | ||
libjpeg62-turbo-dev \ | ||
libpng-dev \ | ||
libxml2-dev \ | ||
locales \ | ||
npm \ | ||
unzip | ||
|
||
# install locales for i18n | ||
RUN echo 'cs_CZ.UTF-8 UTF-8' >> /etc/locale.gen && \ | ||
echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && \ | ||
locale-gen | ||
|
||
# install composer | ||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | ||
|
||
# install apache EXTENSIONS | ||
RUN docker-php-ext-configure gd --with-freetype --with-jpeg | ||
RUN EXTENSIONS="gettext soap opcache gd" \ | ||
&& docker-php-ext-install $EXTENSIONS \ | ||
&& docker-php-ext-enable $EXTENSIONS | ||
RUN a2enmod rewrite proxy proxy_http | ||
|
||
# install recommended config | ||
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" | ||
|
||
COPY ./entrypoint.sh / | ||
CMD /entrypoint.sh | ||
|
||
EXPOSE 80 | ||
|
||
ENV MODE=prod | ||
ENV NETTE_DEVEL=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Docker | ||
`Dockerfile` a `docker-compose` pro jednoduché spuštění webů. | ||
|
||
## Vývoj webů | ||
- nutnost: nainstalovaný `docker` a `docker-compose-plugin` | ||
- vytvoření aktuální image: `docker compose build` (potřeba spustit před prvním spuštěním) | ||
- spuštění: `docker compose up` | ||
- doplnění přihlašovacích údajů do FKSDB do `local/*.neon` (nutno případné promazání cache v `temp` ) | ||
- přístup: `localhost` na portech `8080-8084` | ||
- spouštění příkazů uvnitř dockeru (`composer install`, `npm build` atd.): `docker exec -it webs <příkaz>` | ||
- nainstalování composer balíčků: `docker exec -it webs composer install` | ||
- nainstalování npm balíčků: `docker exec -it webs npm install` | ||
- build CSS a JS: | ||
- jednorázově: `docker exec -it webs npm run build` | ||
- kontinuálně: `docker exec -it webs npm run dev` | ||
- dostání se do konzole přímo uvnitř kontejneru: `docker exec -it webs /bin/bash` | ||
|
||
## Produkce | ||
### Setup | ||
- vytvoření hlavní složky pro vše, například `data` | ||
- clone repozitáře `webs` do této složky `data`, ve výsledku tedy `data/webs` | ||
- zkopírování souboru `docker-compose.prod.yml` do `data/docker-compose.yml` | ||
``` | ||
cp webs/config/docker-compose.prod.yml docker-compose.yml | ||
``` | ||
- vytvoření všech potřebných složek | ||
``` | ||
mkdir -p config/local temp log photos/dsef photos/fof photos/fol photos/fykos photos/vyfuk | ||
``` | ||
- zkopírování Apache konfigurace | ||
``` | ||
cp webs/config/apache.conf config/ | ||
``` | ||
- vytvoření složky `config/local` pro lokální konfigurace všech webů a její naplnění | ||
``` | ||
cp webs/app/config/config.local.neon.example config/local/dsef.neon | ||
cp webs/app/config/config.local.neon.example config/local/fol.neon | ||
cp webs/app/config/config.local.neon.example config/local/fof.neon | ||
cp webs/app/config/config.local.neon.example config/local/fykos.neon | ||
cp webs/app/config/config.local.neon.example config/local/vyfuk.neon | ||
``` | ||
- změna potřebné konfigurace ve všech souborech a zapnutí `docker compose` | ||
- nainstalování composer a npm balíčků | ||
- build npm |
Oops, something went wrong.