diff --git a/.env b/.env new file mode 100644 index 000000000..5f4f9d637 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +HUGO_VERSION=0.136.5-ext-ubuntu \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..779239cc2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +ARG HUGO_VERSION + +FROM floryn90/hugo:${HUGO_VERSION} + +# Switch to root user to install dependencies +USER root + +# Install Node.js and npm +RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - +RUN apt-get -yq update && apt-get -yq upgrade && apt-get install -yq nodejs && npm --version + +# Set the working directory +WORKDIR /src + +# Install npm dependencies +COPY package.json package-lock.json ./ +RUN npm install + +# Copy the rest of your app's source code +COPY . . + +# Set permissions for the /src directory +RUN chown -R hugo:hugo /src + +# Switch back to the original user +# USER hugo + +CMD ["hugo", "server", "-D", "-F"] \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 000000000..7bc5c397c --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,18 @@ +services: + server: + # build: + # context: . + # dockerfile: Dockerfile + # args: + # HUGO_VERSION: ${HUGO_VERSION} + image: floryn90/hugo:${HUGO_VERSION} + command: ["server", "-D", "-F"] + volumes: + - ".:/src" + ports: + - "1313:1313" + deploy: + resources: + limits: + cpus: '2' + memory: 512M \ No newline at end of file