Skip to content

Commit a7221d8

Browse files
committed
remove arm sharp Dockerfile, test docker-compose.yml
1 parent 6766ae0 commit a7221d8

File tree

5 files changed

+50
-3
lines changed

5 files changed

+50
-3
lines changed

docker-compose.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# run production locally
2+
13
version: '3.8'
24

35
services:
@@ -9,6 +11,9 @@ services:
911
dockerfile: ./docker/Dockerfile
1012
args:
1113
ARG_SITE_URL: 'http://localhost:8080'
14+
# make separate script with localhost enabled
15+
ARG_PLAUSIBLE_SCRIPT_URL: 'https://plausible.arm1.nemanjamitic.com/js/script.js'
16+
1217
# platform: linux/arm64
1318
platform: linux/amd64
1419
restart: unless-stopped

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN yarn install --frozen-lockfile
1616

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

2121
COPY . .
2222

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Dockerfile from Astro docs
2+
3+
# alpine is fine
4+
# node:22.1.0-bookworm, node:20.13.1-slim, node:20.13.1-alpine
5+
ARG NODE_IMAGE=node:20.13.1-alpine
6+
7+
FROM ${NODE_IMAGE} AS base
8+
WORKDIR /app
9+
10+
# for alpine
11+
RUN apk add --no-cache git
12+
13+
FROM base AS build
14+
COPY package.json yarn.lock ./
15+
RUN yarn install --frozen-lockfile
16+
17+
# override sharp 0.32.6 with 0.33.3, fails without this
18+
RUN yarn remove sharp
19+
# RUN yarn add --arch=arm64 --platform=linux --libc=musl --ignore-engines [email protected]
20+
RUN yarn add --ignore-engines [email protected]
21+
22+
COPY . .
23+
24+
# build time only env var
25+
ARG ARG_SITE_URL
26+
ENV SITE_URL=$ARG_SITE_URL
27+
RUN echo "SITE_URL=$SITE_URL"
28+
29+
ARG ARG_PLAUSIBLE_SCRIPT_URL
30+
ENV PLAUSIBLE_SCRIPT_URL=$ARG_PLAUSIBLE_SCRIPT_URL
31+
RUN echo "PLAUSIBLE_SCRIPT_URL=$PLAUSIBLE_SCRIPT_URL"
32+
33+
RUN yarn build
34+
35+
FROM nginx:stable-alpine3.17-slim AS runtime
36+
COPY ./docker/nginx.conf /etc/nginx/nginx.conf
37+
38+
# sufficient for SSG
39+
COPY --from=build /app/dist /usr/share/nginx/html
40+
EXPOSE 8080
41+

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"deploy:docker:local": "bash scripts/deploy-docker.sh lxc11 '~/traefik-proxy/apps/nmc-docker' nemanjamitic/nemanjam.github.io",
2222
"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 .",
2323
"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 .",
24-
"docker:push": "docker push nemanjamitic/nemanjam.github.io"
24+
"docker:push": "docker push nemanjamitic/nemanjam.github.io",
25+
"dc:up": "docker compose up --build --force-recreate -d"
2526
},
2627
"dependencies": {
2728
"@astrojs/mdx": "^3.1.3",

src/pages/about.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import Link from '../components/Link.astro';
1212
import Electronics1Image from '../assets/images/all-images/electronics1.jpg';
1313

1414

15-
export const { SITE_URL, AUTHOR_GITHUB, AUTHOR_LINKEDIN, AUTHOR_TWITTER, AUTHOR_YOUTUBE, REPO_URL } = CONFIG_CLIENT;
15+
export const { AUTHOR_GITHUB, AUTHOR_LINKEDIN, AUTHOR_TWITTER, AUTHOR_YOUTUBE } = CONFIG_CLIENT;
1616

1717
# About
1818

0 commit comments

Comments
 (0)