Cleanup justfile and dockerfile
- Add a gitignore for output directory - Make justfile use multi-lines for readability - Remove COPY step from Dockerfile
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
public
|
@@ -5,6 +5,4 @@ WORKDIR /opt/app
|
||||
RUN npm init -y
|
||||
RUN npm install @11ty/eleventy
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD [ "npx", "@11ty/eleventy" ]
|
||||
|
32
justfile
32
justfile
@@ -1,13 +1,35 @@
|
||||
set shell := ["bash", "-c"]
|
||||
|
||||
HOST_PORT := "1280"
|
||||
|
||||
# List just commands by default
|
||||
default:
|
||||
@just --list
|
||||
|
||||
# Build image
|
||||
build:
|
||||
docker buildx build -f ./docker/Dockerfile --tag 11ty:latest .
|
||||
# Build the docker image
|
||||
docker-build:
|
||||
docker buildx build \
|
||||
-f ./docker/Dockerfile \
|
||||
--tag 11ty:latest \
|
||||
.
|
||||
|
||||
# Run development server
|
||||
dev: build
|
||||
docker run -it -p 1280:8080 11ty:latest npx @11ty/eleventy --serve
|
||||
dev:
|
||||
docker run \
|
||||
-it \
|
||||
-p {{HOST_PORT}}:8080 \
|
||||
-v ./src:/opt/app/src \
|
||||
-v ./public:/opt/app/public \
|
||||
-v ./.eleventy.js:/opt/app/.eleventy.js \
|
||||
11ty:latest \
|
||||
npx @11ty/eleventy --serve
|
||||
|
||||
# Build static site files
|
||||
build-site:
|
||||
docker run \
|
||||
-it \
|
||||
-v ./src:/opt/app/src \
|
||||
-v ./public:/opt/app/public \
|
||||
-v ./.eleventy.js:/opt/app/.eleventy.js \
|
||||
11ty:latest \
|
||||
npx @11ty/eleventy
|
||||
|
Reference in New Issue
Block a user