Skip to content

Commit

Permalink
docker: edit docker steps and add README file #TASK-6559
Browse files Browse the repository at this point in the history
  • Loading branch information
juanrizetta committed Sep 5, 2024
1 parent 3bed704 commit ba103a8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
19 changes: 9 additions & 10 deletions docker/iva-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM httpd:2.4-bullseye
## Custom httpd.conf file to update exposed port from 80 to 8080
COPY ./docker/iva-app/custom-httpd.conf /usr/local/apache2/conf/httpd.conf

## To run the docker use:
Expand All @@ -16,27 +17,25 @@ LABEL org.label-schema.vendor="OpenCB" \
## Update and create iva user
RUN apt-get update && apt-get -y upgrade && \
apt-get install -y vim jq && \
rm -rf /var/lib/apt/lists/*
rm -rf /var/lib/apt/lists/* && \
chown -R www-data /usr/local/apache2/logs/

## Allow to build different images by passing the path to the SITE
ARG SITE=src/sites

## Copy files
## IVA
COPY ./build/iva /usr/local/apache2/htdocs/iva
COPY ./${SITE}/iva/conf /usr/local/apache2/htdocs/iva/conf/
COPY ./${SITE}/iva/img /usr/local/apache2/htdocs/iva/img/
COPY --chown=www-data ./build/iva /usr/local/apache2/htdocs/iva
COPY --chown=www-data ./${SITE}/iva/conf /usr/local/apache2/htdocs/iva/conf/
COPY --chown=www-data ./${SITE}/iva/img /usr/local/apache2/htdocs/iva/img/

RUN true

## API
COPY ./build/api /usr/local/apache2/htdocs/api
COPY ./${SITE}/api/conf /usr/local/apache2/htdocs/api/conf/
COPY ./${SITE}/api/img /usr/local/apache2/htdocs/api/img/
COPY --chown=www-data ./build/api /usr/local/apache2/htdocs/api
COPY --chown=www-data ./${SITE}/api/conf /usr/local/apache2/htdocs/api/conf/
COPY --chown=www-data ./${SITE}/api/img /usr/local/apache2/htdocs/api/img/

## Change owner
RUN chown -R www-data /usr/local/apache2/htdocs/
RUN chown -R www-data /usr/local/apache2/logs/
## Run Docker images as non root
USER www-data

Expand Down
17 changes: 17 additions & 0 deletions docker/iva-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# How to update this docker

If you want to update the base image https://hub.docker.com/_/httpd , it is necesary repeat this steps

To customize the configuration of the httpd server, first obtain the upstream default configuration from the container:

```bash
docker run --rm httpd:2.4-bullseye cat /usr/local/apache2/conf/httpd.conf > ./docker/iva-app/custom-httpd.conf
```

And then change custom-httpd.conf

```
Listen 8080
```


0 comments on commit ba103a8

Please sign in to comment.