-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (29 loc) · 1.23 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Use an official Python runtime as a parent image
ARG PYTHON_VERSION=3.11
FROM python:${PYTHON_VERSION}-slim-bullseye AS builder
# Set the working directory in the container to /app
WORKDIR /app
ARG GO_VERSION=1.21.6
ARG HUGO_VERSION=0.121.2
ARG TARGETARCH
# install wget and git
RUN apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y git wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN wget https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz && tar -C /usr/local -xzf go${GO_VERSION}.linux-${TARGETARCH}.tar.gz
ENV PATH="/usr/local/go/bin:/usr/local:${PATH}"
RUN go version
RUN wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-${TARGETARCH}.tar.gz \
&& tar -C /bin -xzf hugo_extended_${HUGO_VERSION}_linux-${TARGETARCH}.tar.gz \
&& rm hugo_extended_${HUGO_VERSION}_linux-${TARGETARCH}.tar.gz
RUN hugo version
# Install Poetry
RUN pip install poetry
# Copy the current directory contents into the container at /app
COPY . /app
# # Use Poetry to install dependencies
RUN poetry config virtualenvs.create true && poetry install --no-interaction --no-ansi
# Run main.py when the container launches
CMD ["poetry", "run", "python", "main.py"]