Skip to content
Snippets Groups Projects
Commit 555711fe authored by Pierre Chanial's avatar Pierre Chanial
Browse files

Reduce image size.

parent 5ccff3d3
No related branches found
No related tags found
1 merge request!8Resolve "Reduce esap-db image size"
Pipeline #15391 passed
......@@ -15,7 +15,7 @@ variables:
DBPROJECT_USER: postgres
DBPROJECT_PASSWORD: postgres
DOMAIN: localhost
ESAP_DB_IMAGE: ${CI_REGISTRY_IMAGE}:latest
ESAP_DB_IMAGE: ${CI_REGISTRY_IMAGE}
before_script:
- docker version
......@@ -36,7 +36,9 @@ build:
- docker-compose -f host-files/docker-compose.yml config > host-files/docker-stack.yml
- docker-compose -f host-files/docker-stack.yml build
- echo ${CI_JOB_TOKEN} | docker login -u "${CI_REGISTRY_USER}" --password-stdin "${CI_REGISTRY}"
- docker push ${ESAP_DB_IMAGE}
- docker tag ${ESAP_DB_IMAGE}:latest ${ESAP_DB_IMAGE}:${CI_COMMIT_BRANCH}-${CI_COMMIT_SHORT_SHA}
- docker push ${ESAP_DB_IMAGE}:latest
- docker push ${ESAP_DB_IMAGE}:${CI_COMMIT_BRANCH}-${CI_COMMIT_SHORT_SHA}
test-functional:
stage: test
......
# Pull base image
FROM python:3.9
FROM python:3.9-slim
# Set environment varibles
ENV PYTHONDONTWRITEBYTECODE 1
......@@ -8,10 +8,11 @@ ENV PYTHONUNBUFFERED 1
WORKDIR /code/
# Install Poetry
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | POETRY_HOME=/opt/poetry python && \
cd /usr/local/bin && \
ln -s /opt/poetry/bin/poetry && \
poetry config virtualenvs.create false
RUN apt-get update && apt-get install -y curl libpq-dev gcc
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | POETRY_HOME=/opt/poetry python \
&& cd /usr/local/bin \
&& ln -s /opt/poetry/bin/poetry \
&& poetry config virtualenvs.create false
# Copy poetry.lock* in case it doesn't exist in the repo
COPY ./pyproject.toml ./poetry.lock* /code/
......
......@@ -3,7 +3,7 @@ version: "3"
services:
esap-db:
image: ${ESAP_DB_IMAGE:-esap-db:latest}
image: ${ESAP_DB_IMAGE:-esap-db}:latest
container_name: esap-db
stdin_open: true # docker run -i
tty: true # docker run -t
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment