Skip to content

Commit 0b9e289

Browse files
committed
fixed docker
1 parent 59aa7eb commit 0b9e289

File tree

2 files changed

+15
-27
lines changed

2 files changed

+15
-27
lines changed

Docker/app.dockerfile

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
FROM --platform=linux/amd64 python:3.9-slim-buster as python
1+
FROM --platform=linux/amd64 python:3.10.12-slim-buster as python
22

33
# Metadata
4-
LABEL name="PBG Website"
4+
LABEL name="Mkdocs website"
55
LABEL maintainer="PBG"
66
LABEL version="0.1"
77

88
ARG YOUR_ENV="virtualenv"
9-
ARG POETRY_VERSION="1.5.1"
9+
ARG POETRY_VERSION="1.7.1"
1010

1111
ENV YOUR_ENV=${YOUR_ENV} \
1212
PYTHONDONTWRITEBYTECODE=1 \
@@ -31,22 +31,8 @@ ENV PATH="$POETRY_HOME/bin:$PATH"
3131
# COPY bin/ssh-config.sh /usr/bin
3232
# RUN chmod +x /usr/bin/ssh-config.sh
3333

34-
# Install libraries
3534
RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y \
36-
libpq-dev gcc wget gnupg2 curl openssh-client git make build-essential \
37-
make build-essential libssl-dev zlib1g-dev \
38-
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
39-
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \
40-
pngquant optipng
41-
42-
# # add custom host file for your services
43-
# COPY hosts tmp/
44-
# ADD hosts /tmp/hosts
45-
# # Warning: if you test on M1 and arch64 architecture you could have an issue with this line
46-
# RUN mkdir -p -- /lib-override && cp /lib/x86_64-linux-gnu/libnss_files.so.2 /lib-override
47-
# # If you are using mac or arch64 change X86_64-linux-gnu with aarch64-linux-gnu
48-
# RUN perl -pi -e 's:/etc/hosts:/tmp/hosts:g' /lib-override/libnss_files.so.2
49-
# ENV LD_LIBRARY_PATH /lib-override
35+
wget curl libpq-dev gcc wget gnupg2 curl openssh-client make git build-essential
5036

5137
RUN wget -O install-poetry.py https://install.python-poetry.org/ \
5238
&& python install-poetry.py --version ${POETRY_VERSION}
@@ -64,6 +50,7 @@ RUN poetry install --no-interaction --no-ansi --only main && \
6450
RUN poetry cache clear --all pypi
6551

6652
COPY docs ./docs
53+
COPY myapp ./myapp
6754
COPY Makefile .
6855
COPY mkdocs.yml .
6956

Docker/test.dockerfile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/pythonbiellagroup/dockbase/python-base:0.0.3 as python
1+
FROM --platform=linux/amd64 ghcr.io/pythonbiellagroup/dockbase/python-base:0.0.4 as python
22

33
# Metadata
44
LABEL name="PBG Website"
@@ -8,10 +8,11 @@ LABEL version="0.1"
88
# Project Python definition
99
WORKDIR /app
1010

11-
#Copy all the project files
12-
COPY pyproject.toml .
13-
COPY poetry.lock .
14-
COPY poetry.toml .
11+
#Copy poetry files
12+
COPY pyproject.toml poetry.lock poetry.toml ./
13+
14+
RUN poetry install --no-interaction --no-ansi --only main && \
15+
rm -rf /root/.cache/pypoetry
1516

1617
# You need to create a .env file in your project to download the private package from github
1718
# With GHCR_USERNAME and GHCR_TOKEN
@@ -21,8 +22,7 @@ COPY poetry.toml .
2122
# RUN . /app/.env && poetry config http-basic.mkdocs ${GHCR_USERNAME} ${GHCR_TOKEN} && \
2223
# poetry install --no-interaction --no-ansi --only main && \
2324
# rm -rf /root/.cache/pypoetry
24-
RUN poetry install --no-interaction --no-ansi --only main && \
25-
rm -rf /root/.cache/pypoetry
25+
2626
RUN poetry cache clear --all pypi
2727

2828
COPY docs ./docs
@@ -32,9 +32,10 @@ COPY Makefile .
3232
COPY mkdocs.yml .
3333
# COPY mkdocs.insiders.yml .
3434

35-
RUN make docs_build
35+
# RUN make docs_build
36+
RUN mkdocs build --clean --quiet --config-file mkdocs.yml
3637

37-
FROM nginx as deploy
38+
FROM --platform=linux/amd64 nginx as deploy
3839

3940
COPY --from=python /app/site /usr/share/nginx/html
4041

0 commit comments

Comments
 (0)