From cc6c803d82ffac23ff61fb7b9c47f124d469ed78 Mon Sep 17 00:00:00 2001 From: zenlex Date: Sat, 10 Feb 2024 16:13:42 -0600 Subject: [PATCH 1/2] feat: setup basic docker dev environment --- .dockerignore | 9 +++++++++ Dockerfile | 13 +++++++++++++ astro.config.mjs | 3 +++ docker-compose.yml | 12 ++++++++++++ entrypoint.sh | 2 ++ 5 files changed, 39 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 entrypoint.sh diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..4b6c74ee --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +Dockerfile + +node_modules +.dockerignore +.gitignore +.git +.env +.vscode +.github diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..4c5318aa --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM node:20 + +WORKDIR /app + +COPY package.json package-lock.json ./ + +RUN npm ci + +COPY . . + +RUN chmod +x entrypoint.sh + +CMD ["sh", "/app/entrypoint.sh"] diff --git a/astro.config.mjs b/astro.config.mjs index 253aaf53..bf0b7e95 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -6,4 +6,7 @@ export default defineConfig({ site: 'https://tulsawebdevs.github.io', base: '/website', integrations: [tailwind()], + server:{ + host: true + } }); diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..24f4fb4f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +services: + app: + build: ./ + restart: unless-stopped + volumes: + - ./:/app + - node_modules:/app/node_modules + ports: + - 4321:4321 + +volumes: + node_modules: diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 00000000..61596cac --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,2 @@ +#!/bin/bash +npm run dev From d35b08b53811d86169421af754787eea0b94f243 Mon Sep 17 00:00:00 2001 From: zenlex Date: Sat, 10 Feb 2024 16:35:08 -0600 Subject: [PATCH 2/2] fix: use entrypoint ci instead of volume bind for npm --- docker-compose.yml | 4 ---- entrypoint.sh | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 24f4fb4f..2d512574 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,9 +4,5 @@ services: restart: unless-stopped volumes: - ./:/app - - node_modules:/app/node_modules ports: - 4321:4321 - -volumes: - node_modules: diff --git a/entrypoint.sh b/entrypoint.sh index 61596cac..dfac1739 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,2 +1,3 @@ #!/bin/bash +npm ci npm run dev