-
Notifications
You must be signed in to change notification settings - Fork 1
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
Use a registry for storing docker frontend image #57
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,19 +5,20 @@ volumes: | |
|
||
services: | ||
builder: | ||
image: "ghcr.io/jolicode/monologue/builder:${BUILDER_VERSION:-latest}" | ||
lyrixx marked this conversation as resolved.
Show resolved
Hide resolved
|
||
build: | ||
context: services/php | ||
target: builder | ||
# cache_to: | ||
# - "ghcr.io/jolicode/monologue/builder:${BUILDER_VERSION:-latest}" | ||
# cache_from: | ||
# - "ghcr.io/jolicode/monologue/builder:${BUILDER_VERSION:-latest}" | ||
Comment on lines
+12
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we want, we can share the cache on the registry. Not sure it's useful tho |
||
depends_on: | ||
- postgres | ||
environment: | ||
- COMPOSER_MEMORY_LIMIT=-1 | ||
# The following list contains the common environment variables exposed by CI platforms | ||
- UID=${USER_ID} | ||
- GITHUB_ACTIONS | ||
- CI # Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari | ||
- CONTINUOUS_INTEGRATION # Travis CI, Cirrus CI | ||
- BUILD_NUMBER # Jenkins, TeamCity | ||
- RUN_ID # TaskCluster, dsari | ||
volumes: | ||
- "../../${PROJECT_DIRECTORY}:/home/app/application:cached" | ||
- "${COMPOSER_CACHE_DIR}:/home/app/.composer/cache" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,15 +5,27 @@ volumes: | |
|
||
services: | ||
router: | ||
build: services/router | ||
image: "ghcr.io/jolicode/monologue/router:${ROUTER_VERSION:-latest}" | ||
build: | ||
context: services/router | ||
# cache_to: | ||
# - "ghcr.io/jolicode/monologue/router:${ROUTER__VERSION:-latest}" | ||
# cache_from: | ||
# - "ghcr.io/jolicode/monologue/router:${ROUTER__VERSION:-latest}" | ||
volumes: | ||
- "/var/run/docker.sock:/var/run/docker.sock" | ||
- "./services/router/certs:/etc/ssl/certs" | ||
network_mode: host | ||
|
||
frontend: | ||
image: "ghcr.io/jolicode/monologue/frontend:${FRONTEND_VERSION:-latest}" | ||
build: | ||
context: services/php | ||
target: frontend | ||
# cache_to: | ||
# - "ghcr.io/jolicode/monologue/frontend:${FRONTEND_VERSION:-latest}" | ||
# cache_from: | ||
# - "ghcr.io/jolicode/monologue/frontend:${FRONTEND_VERSION:-latest}" | ||
depends_on: | ||
- postgres | ||
volumes: | ||
|
@@ -29,7 +41,7 @@ services: | |
- "traefik.http.routers.${PROJECT_NAME}-frontend-unsecure.middlewares=redirect-to-https@file" | ||
|
||
postgres: | ||
build: services/postgres | ||
image: postgres:15.2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid pushing an extra image to the registry |
||
environment: | ||
POSTGRES_PASSWORD: monologue | ||
POSTGRES_USER: monologue | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
set -u | ||
|
||
if [ $(id -u) != 0 ]; then | ||
echo "Running this image as non root is not allowed" | ||
exit 1 | ||
fi | ||
|
||
: "${UID:=0}" | ||
: "${GID:=${UID}}" | ||
|
||
if [ "$#" = 0 ]; then | ||
set -- "$(command -v bash 2>/dev/null || command -v sh)" -l | ||
fi | ||
|
||
if [ "$UID" != 0 ]; then | ||
usermod -u "$UID" "{{ application_user }}" >/dev/null 2>/dev/null && { | ||
groupmod -g "$GID" "{{ application_user }}" >/dev/null 2>/dev/null || | ||
usermod -a -G "$GID" "{{ application_user }}" >/dev/null 2>/dev/null | ||
} | ||
set -- gosu "${UID}:${GID}" "${@}" | ||
fi | ||
|
||
exec "$@" |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
FROM traefik:v2.7 | ||
|
||
COPY etc/. /etc/ | ||
LABEL org.opencontainers.image.source https://github.com/jolicode/monologue | ||
|
||
COPY traefik /etc/traefik | ||
|
||
VOLUME [ "/etc/ssl/certs" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not possible to exec something with something else than
app
. Anyway, we never changed this value, right?