diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..ed9572b --- /dev/null +++ b/.env.example @@ -0,0 +1,8 @@ +# OAuth 2.0 Client ID. Create one at Google Cloud Console > APIs & Services > Credentials +VITE_CLIENT_ID= + +# OpenRouteService API key. Create one at OpenRouteService dev dashboard > Tokens +VITE_OPENROUTESERVICE_API_KEY= + +# Specify backend URL here +VITE_BACKEND_URL= \ No newline at end of file diff --git a/.gitignore b/.gitignore index a547bf3..025cdbf 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,6 @@ dist-ssr *.njsproj *.sln *.sw? + +#env +.env diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index c027599..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,25 +0,0 @@ -stages: - - prepare - - build - - deploy - -remove-old-services: - stage: prepare - script: - - podman stop little-lines - - podman rm little-lines - -container-build: - stage: build - script: - - sed -i "s/DATE/$(date -I)/g" ${CI_PROJECT_DIR}/src/views/About.vue - - sed -i "s/VERSION/$(git log -1 --oneline | awk '{print $1}')/g" ${CI_PROJECT_DIR}/src/views/About.vue - - podman build -t little-lines . - -container-deploy: - stage: deploy - script: - - podman run --name little-lines -p 8081:80 -d little-lines - - podman generate systemd little-lines > ~/.config/systemd/user/little-lines.service - - systemctl --user daemon-reload - - systemctl --user enable little-lines \ No newline at end of file diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..af2a63e --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,23 @@ +when: + - branch: main + event: push + - event: tag + +steps: + - name: deploy + image: node + commands: + - npm i + - npm run build + - rm -rf /mnt/caddy-sites/little-lines.techtransthai.org/* + - cp -r dist/* /mnt/caddy-sites/little-lines.techtransthai.org/ + volumes: + - /media/core/Data1/Apps/caddy/sites:/mnt/caddy-sites + environment: + VITE_BACKEND_URL: https://little-lines-backend.techtransthai.org + VITE_CLIENT_ID: + from_secret: client_id + VITE_OPENROUTESERVICE_API_KEY: + from_secret: ors_api_key + + diff --git a/Dockerfile b/Dockerfile index 2094672..4a01004 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,15 @@ -FROM nginx:alpine +FROM docker.io/library/alpine:latest # Set up environment for building -RUN apk add yarn nodejs +RUN apk add nodejs npm # Copy files to build environment -RUN mkdir /opt/micromobility-navigation -COPY . /opt/micromobility-navigation +RUN mkdir /opt/little-lines-frontend +COPY . /opt/little-lines-frontend + +# Start the app +WORKDIR /opt/little-lines-frontend +RUN npm i +CMD npm run dev -- --host -# Run Vite production build -WORKDIR /opt/micromobility-navigation -RUN yarn -RUN yarn run build -# Copy files to nginx path -RUN cp -r dist/* icons /usr/share/nginx/html diff --git a/README.md b/README.md index 01042ab..f3a8674 100644 --- a/README.md +++ b/README.md @@ -1,99 +1,48 @@ -# Little Lines -Quick setup via Podman/Docker +
{{ nearestStructureData.display_name }}
+ +TechTransThai Community
+ + +