mirror of
https://gitlab.com/little-lines/backend.git
synced 2024-11-22 00:16:51 +00:00
Add Docker and CI stuff
This commit is contained in:
parent
f1f614d4e7
commit
95d28e5952
2 changed files with 37 additions and 0 deletions
23
.gitlab-ci.yml
Normal file
23
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
stages:
|
||||||
|
- prepare
|
||||||
|
- build
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
remove-old-services:
|
||||||
|
stage: prepare
|
||||||
|
script:
|
||||||
|
- podman stop ll-backend
|
||||||
|
- podman rm ll-backend
|
||||||
|
|
||||||
|
container-build:
|
||||||
|
stage: build
|
||||||
|
script:
|
||||||
|
- podman build -t ll-backend .
|
||||||
|
|
||||||
|
container-deploy:
|
||||||
|
stage: deploy
|
||||||
|
script:
|
||||||
|
- podman run --name ll-backend -p 5001:5001 -d ll-backend
|
||||||
|
- podman generate systemd ll-backend > ~/.config/systemd/user/ll-backend.service
|
||||||
|
- systemctl --user daemon-reload
|
||||||
|
- systemctl --user enable ll-backend
|
14
Dockerfile
Normal file
14
Dockerfile
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
FROM nginx:alpine
|
||||||
|
|
||||||
|
# Set up environment for building
|
||||||
|
RUN apk add yarn nodejs
|
||||||
|
|
||||||
|
# Copy files to build environment
|
||||||
|
RUN mkdir /opt/ll-backend
|
||||||
|
RUN cp /home/sasha/Data1/Apps/ll-backend/.env /opt/ll-backend
|
||||||
|
COPY . /opt/ll-backend
|
||||||
|
|
||||||
|
# Run Vite production build
|
||||||
|
WORKDIR /opt/ll-backend
|
||||||
|
RUN yarn
|
||||||
|
CMD yarn run start
|
Loading…
Reference in a new issue