Fixed release file build (did not include frontend files), formatting
This commit is contained in:
parent
bdb653090c
commit
590adffa93
|
@ -12,6 +12,7 @@ variables:
|
||||||
DOCROOT: /var/www/
|
DOCROOT: /var/www/
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
|
- build-frontend
|
||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
- release
|
- release
|
||||||
|
@ -26,20 +27,20 @@ stages:
|
||||||
before_script:
|
before_script:
|
||||||
- docker login -u gitlab-ci-token -p "${CI_JOB_TOKEN}" "${CI_REGISTRY}"
|
- docker login -u gitlab-ci-token -p "${CI_JOB_TOKEN}" "${CI_REGISTRY}"
|
||||||
|
|
||||||
|
build-image.nginx:
|
||||||
|
<<: *docker_definition
|
||||||
|
stage: build-frontend
|
||||||
|
script:
|
||||||
|
- docker build --pull -t "${TEST_IMAGE}-nginx" -f contrib/nginx/Dockerfile .
|
||||||
|
- docker push "${TEST_IMAGE}-nginx"
|
||||||
|
|
||||||
build-image:
|
build-image:
|
||||||
<<: *docker_definition
|
<<: *docker_definition
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- docker build --pull -t "${TEST_IMAGE}" -f contrib/Dockerfile .
|
- docker build --pull --build-arg NGINX_IMAGE="${TEST_IMAGE}-nginx" -t "${TEST_IMAGE}" -f contrib/Dockerfile .
|
||||||
- docker push "${TEST_IMAGE}"
|
- docker push "${TEST_IMAGE}"
|
||||||
|
|
||||||
build-image.nginx:
|
|
||||||
<<: *docker_definition
|
|
||||||
stage: build
|
|
||||||
script:
|
|
||||||
- docker build --pull -t "${TEST_IMAGE}.nginx" -f contrib/nginx/Dockerfile .
|
|
||||||
- docker push "${TEST_IMAGE}.nginx"
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
image: ${TEST_IMAGE}
|
image: ${TEST_IMAGE}
|
||||||
stage: test
|
stage: test
|
||||||
|
|
|
@ -91,8 +91,8 @@ docker-compose build
|
||||||
|
|
||||||
or to build the containers separately
|
or to build the containers separately
|
||||||
```bash
|
```bash
|
||||||
docker build -f contrib/Dockerfile . -t engelsystem
|
|
||||||
docker build -f contrib/nginx/Dockerfile . -t engelsystem-nginx
|
docker build -f contrib/nginx/Dockerfile . -t engelsystem-nginx
|
||||||
|
docker build -f contrib/Dockerfile . -t engelsystem
|
||||||
```
|
```
|
||||||
|
|
||||||
Import database
|
Import database
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
"psr/log": "^1.0",
|
"psr/log": "^1.0",
|
||||||
"symfony/http-foundation": "^3.3",
|
"symfony/http-foundation": "^3.3",
|
||||||
"symfony/psr-http-message-bridge": "^1.0",
|
"symfony/psr-http-message-bridge": "^1.0",
|
||||||
"twbs/bootstrap": "^3.3",
|
|
||||||
"twig/extensions": "^1.5",
|
"twig/extensions": "^1.5",
|
||||||
"twig/twig": "^2.5",
|
"twig/twig": "^2.5",
|
||||||
"zendframework/zend-diactoros": "^1.7"
|
"zendframework/zend-diactoros": "^1.7"
|
||||||
|
|
|
@ -1,8 +1,14 @@
|
||||||
|
# Setup
|
||||||
|
ARG NGINX_IMAGE=engelsystem-nginx:latest
|
||||||
|
|
||||||
|
# composer install
|
||||||
FROM composer AS composer
|
FROM composer AS composer
|
||||||
COPY composer.json /app/
|
COPY composer.json /app/
|
||||||
RUN composer --no-ansi install --no-dev --ignore-platform-reqs
|
RUN composer --no-ansi install --no-dev --ignore-platform-reqs
|
||||||
RUN composer --no-ansi dump-autoload --optimize
|
RUN composer --no-ansi dump-autoload --optimize
|
||||||
|
|
||||||
|
# Use frontend container for assets
|
||||||
|
FROM ${NGINX_IMAGE} AS frontend
|
||||||
|
|
||||||
# Intermediate container for less layers
|
# Intermediate container for less layers
|
||||||
FROM alpine as data
|
FROM alpine as data
|
||||||
|
@ -11,6 +17,7 @@ COPY config/ /app/config
|
||||||
COPY db/ /app/db
|
COPY db/ /app/db
|
||||||
COPY includes/ /app/includes
|
COPY includes/ /app/includes
|
||||||
COPY public/ /app/public
|
COPY public/ /app/public
|
||||||
|
COPY --from=frontend /var/www/public/assets/ /app/public/assets
|
||||||
COPY resources/lang /app/resources/lang
|
COPY resources/lang /app/resources/lang
|
||||||
COPY resources/views /app/resources/views
|
COPY resources/views /app/resources/views
|
||||||
COPY src/ /app/src
|
COPY src/ /app/src
|
||||||
|
@ -22,6 +29,7 @@ COPY --from=composer /app/composer.lock /app/
|
||||||
|
|
||||||
RUN rm -f /app/config/config.php
|
RUN rm -f /app/config/config.php
|
||||||
|
|
||||||
|
# Build the PHP container
|
||||||
FROM php:7-fpm-alpine
|
FROM php:7-fpm-alpine
|
||||||
WORKDIR /var/www
|
WORKDIR /var/www
|
||||||
COPY --from=data /app/ /var/www
|
COPY --from=data /app/ /var/www
|
||||||
|
|
Loading…
Reference in New Issue