Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ name: Symfony deployment
on:
push:
branches: [ "alpha" ]
# branches: [ "feature/upgrade_symfony" ]
pull_request:
branches: [ "alpha" ]
# branches: [ "feature/upgrade_symfony" ]

permissions:
contents: read
Expand Down Expand Up @@ -119,10 +117,13 @@ jobs:
run: |
if [[ "$DOCKER_BRANCH" == "master" ]]; then
export HOSTNAME="api.$DOMAIN_URL"
export APP_ENV="prod"
elif [[ "$DOCKER_BRANCH" == "preprod" ]]; then
export HOSTNAME="api.$DOCKER_BRANCH.$DOMAIN_URL"
export APP_ENV="prod"
else
export HOSTNAME="api.$DOCKER_BRANCH.$DOMAIN_URL"
export APP_ENV="dev"
fi
ssh staging 'export DOCKER_BRANCH=${{ github.ref_name }} DOCKER_REGISTRY=${{ secrets.DOCKER_REGISTRY }}
cd /var/docker/api/${DOCKER_BRANCH}
Expand Down
19 changes: 9 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
FROM registry.realtoken.community/docker-symfony-php:8.4

# Composer
WORKDIR /var/www/html
COPY . ./
RUN cp .env.dev .env

# Composer install sans .env
RUN composer install --prefer-dist --no-interaction --optimize-autoloader --no-progress

#ARG APP_ENV=prod
ENV APP_ENV=${APP_ENV}
RUN composer dump-env ${APP_ENV}
RUN composer run-script --no-dev post-install-cmd

# HTTPS
ENV HTTPS=false

# Nginx
COPY docker/nginx.conf /etc/nginx/nginx.conf
#COPY docker/blockips.conf /etc/nginx/blockips.conf

RUN mkdir -p var/cache/prod
RUN chmod -R 777 var/cache/prod

# PHP
## Remove fastcgi log debug
#RUN echo 'fastcgi.logging=0' >> "/etc/php7/php.ini"
#RUN echo 'fastcgi.logging=0' >> "/etc/php8/php.ini"
RUN mkdir -p var/cache/${APP_ENV}
RUN chmod -R 777 var/cache/${APP_ENV}

CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
3 changes: 2 additions & 1 deletion docker-compose-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ services:
container_name: ${DOCKER_BRANCH}-api_php-sf
build:
context: ./
args:
APP_ENV: ${APP_ENV}
networks:
- api-${DOCKER_BRANCH}
- traefik-realt
Expand Down Expand Up @@ -51,4 +53,3 @@ networks:
api-${DOCKER_BRANCH}:
traefik-realt:
external: true

Loading