🚚(docker) make images naming consistent

It was quite confusing having development, production and
frontend images' names in the same Docker file. New comers
to the project would have some difficuluties when
differentiating frontend from backend images.

Try to make these naming more explicit and consistent.
Thanks @rouja for your recommendation.
This commit is contained in:
Lebaud Antoine
2024-03-14 17:56:44 +01:00
committed by aleb_the_flash
parent 78459df962
commit a2ff33663b
3 changed files with 11 additions and 11 deletions

View File

@@ -42,7 +42,7 @@ jobs:
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
context: . context: .
target: production target: backend-production
build-args: DOCKER_USER=${{ env.DOCKER_USER }}:-1000 build-args: DOCKER_USER=${{ env.DOCKER_USER }}:-1000
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
@@ -75,7 +75,7 @@ jobs:
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
context: . context: .
target: frontend target: frontend-production
build-args: DOCKER_USER=${{ env.DOCKER_USER }}:-1000 build-args: DOCKER_USER=${{ env.DOCKER_USER }}:-1000
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}

View File

@@ -38,7 +38,7 @@ RUN yarn build
# ---- Front-end image ---- # ---- Front-end image ----
FROM nginxinc/nginx-unprivileged:1.25 as frontend FROM nginxinc/nginx-unprivileged:1.25 as frontend-production
# Un-privileged user running the application # Un-privileged user running the application
ARG DOCKER_USER ARG DOCKER_USER
@@ -147,7 +147,7 @@ WORKDIR /app
ENTRYPOINT [ "/usr/local/bin/entrypoint" ] ENTRYPOINT [ "/usr/local/bin/entrypoint" ]
# ---- Development image ---- # ---- Development image ----
FROM core as development FROM core as backend-development
# Switch back to the root user to install development dependencies # Switch back to the root user to install development dependencies
USER root:root USER root:root
@@ -175,7 +175,7 @@ ENV DB_HOST=postgresql \
CMD python manage.py runserver 0.0.0.0:8000 CMD python manage.py runserver 0.0.0.0:8000
# ---- Production image ---- # ---- Production image ----
FROM core as production FROM core as backend-production
ARG PEOPLE_STATIC_ROOT=/data/static ARG PEOPLE_STATIC_ROOT=/data/static

View File

@@ -19,11 +19,11 @@ services:
app-dev: app-dev:
build: build:
context: . context: .
target: development target: backend-development
args: args:
DOCKER_USER: ${DOCKER_USER:-1000} DOCKER_USER: ${DOCKER_USER:-1000}
user: ${DOCKER_USER:-1000} user: ${DOCKER_USER:-1000}
image: people:development image: people:backend-development
environment: environment:
- PYLINTHOME=/app/.pylint.d - PYLINTHOME=/app/.pylint.d
- DJANGO_CONFIGURATION=Development - DJANGO_CONFIGURATION=Development
@@ -43,7 +43,7 @@ services:
celery-dev: celery-dev:
user: ${DOCKER_USER:-1000} user: ${DOCKER_USER:-1000}
image: people:development image: people:backend-development
command: ["celery", "-A", "people.celery_app", "worker", "-l", "DEBUG"] command: ["celery", "-A", "people.celery_app", "worker", "-l", "DEBUG"]
environment: environment:
- DJANGO_CONFIGURATION=Development - DJANGO_CONFIGURATION=Development
@@ -60,11 +60,11 @@ services:
app: app:
build: build:
context: . context: .
target: production target: backend-production
args: args:
DOCKER_USER: ${DOCKER_USER:-1000} DOCKER_USER: ${DOCKER_USER:-1000}
user: ${DOCKER_USER:-1000} user: ${DOCKER_USER:-1000}
image: people:production image: people:backend-production
environment: environment:
- DJANGO_CONFIGURATION=Demo - DJANGO_CONFIGURATION=Demo
env_file: env_file:
@@ -78,7 +78,7 @@ services:
celery: celery:
user: ${DOCKER_USER:-1000} user: ${DOCKER_USER:-1000}
image: people:production image: people:backend-production
command: ["celery", "-A", "people.celery_app", "worker", "-l", "INFO"] command: ["celery", "-A", "people.celery_app", "worker", "-l", "INFO"]
environment: environment:
- DJANGO_CONFIGURATION=Demo - DJANGO_CONFIGURATION=Demo