Skip to content

Commit

Permalink
remove arm sharp Dockerfile, test docker-compose.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
nemanjam committed Aug 30, 2024
1 parent 6766ae0 commit a7221d8
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 3 deletions.
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# run production locally

version: '3.8'

services:
Expand All @@ -9,6 +11,9 @@ services:
dockerfile: ./docker/Dockerfile
args:
ARG_SITE_URL: 'http://localhost:8080'
# make separate script with localhost enabled
ARG_PLAUSIBLE_SCRIPT_URL: 'https://plausible.arm1.nemanjamitic.com/js/script.js'

# platform: linux/arm64
platform: linux/amd64
restart: unless-stopped
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN yarn install --frozen-lockfile

# override sharp 0.32.6 with 0.33.3, fails without this
RUN yarn remove sharp
RUN yarn add --arch=arm64 --platform=linux --libc=musl --ignore-engines [email protected]
RUN yarn add --ignore-engines [email protected]

COPY . .

Expand Down
41 changes: 41 additions & 0 deletions docs/working-notes/my-old-code/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Dockerfile from Astro docs

# alpine is fine
# node:22.1.0-bookworm, node:20.13.1-slim, node:20.13.1-alpine
ARG NODE_IMAGE=node:20.13.1-alpine

FROM ${NODE_IMAGE} AS base
WORKDIR /app

# for alpine
RUN apk add --no-cache git

FROM base AS build
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile

# override sharp 0.32.6 with 0.33.3, fails without this
RUN yarn remove sharp
# RUN yarn add --arch=arm64 --platform=linux --libc=musl --ignore-engines [email protected]
RUN yarn add --ignore-engines [email protected]

COPY . .

# build time only env var
ARG ARG_SITE_URL
ENV SITE_URL=$ARG_SITE_URL
RUN echo "SITE_URL=$SITE_URL"

ARG ARG_PLAUSIBLE_SCRIPT_URL
ENV PLAUSIBLE_SCRIPT_URL=$ARG_PLAUSIBLE_SCRIPT_URL
RUN echo "PLAUSIBLE_SCRIPT_URL=$PLAUSIBLE_SCRIPT_URL"

RUN yarn build

FROM nginx:stable-alpine3.17-slim AS runtime
COPY ./docker/nginx.conf /etc/nginx/nginx.conf

# sufficient for SSG
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 8080

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"deploy:docker:local": "bash scripts/deploy-docker.sh lxc11 '~/traefik-proxy/apps/nmc-docker' nemanjamitic/nemanjam.github.io",
"docker:build:push:arm": "docker buildx build -f ./docker/Dockerfile -t nemanjamitic/nemanjam.github.io --build-arg ARG_SITE_URL='https://nmc-docker.arm1.nemanjamitic.com' ARG_PLAUSIBLE_SCRIPT_URL='https://plausible.arm1.nemanjamitic.com/js/script.js' --platform linux/arm64 --push .",
"docker:build:push:x86": "docker buildx build -f ./docker/Dockerfile -t nemanjamitic/nemanjam.github.io --build-arg ARG_SITE_URL='https://nmc-docker.local.nemanjamitic.com' ARG_PLAUSIBLE_SCRIPT_URL='https://plausible.arm1.nemanjamitic.com/js/script.js' --platform linux/amd64 --push .",
"docker:push": "docker push nemanjamitic/nemanjam.github.io"
"docker:push": "docker push nemanjamitic/nemanjam.github.io",
"dc:up": "docker compose up --build --force-recreate -d"
},
"dependencies": {
"@astrojs/mdx": "^3.1.3",
Expand Down
2 changes: 1 addition & 1 deletion src/pages/about.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Link from '../components/Link.astro';
import Electronics1Image from '../assets/images/all-images/electronics1.jpg';


export const { SITE_URL, AUTHOR_GITHUB, AUTHOR_LINKEDIN, AUTHOR_TWITTER, AUTHOR_YOUTUBE, REPO_URL } = CONFIG_CLIENT;
export const { AUTHOR_GITHUB, AUTHOR_LINKEDIN, AUTHOR_TWITTER, AUTHOR_YOUTUBE } = CONFIG_CLIENT;

# About

Expand Down

0 comments on commit a7221d8

Please sign in to comment.