-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
55 lines (42 loc) · 1.22 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
FROM node:22.9.0-alpine3.20
ARG POCKETBASE_ADMIN_EMAIL
ARG POCKETBASE_ADMIN_PASSWORD
ARG POCKETBASE_URL
ARG TITLE
ARG API_KEY
ARG CAP1
ARG CAP2
ARG CAP3
# Set environment variables to be overridden at runtime
ENV POCKETBASE_ADMIN_EMAIL=$POCKETBASE_ADMIN_EMAIL
ENV POCKETBASE_ADMIN_PASSWORD=$POCKETBASE_ADMIN_PASSWORD
ENV POCKETBASE_URL=$POCKETBASE_URL
ENV TITLE=$TITLE
ENV API_KEY=$API_KEY
ENV CAP1=$CAP1
ENV CAP2=$CAP2
ENV CAP3=$CAP3
# Install required packages
RUN apk update && apk add --no-cache \
unzip \
curl
# download and unzip PocketBase
ADD https://github.com/pocketbase/pocketbase/releases/download/v0.22.21/pocketbase_0.22.21_linux_amd64.zip /tmp/pb.zip
RUN unzip /tmp/pb.zip -d /pb/
# create PocketBase data directory
RUN mkdir -p /pb/pb_data
# COPY start.sh /pb/start.sh
# start PocketBase in a background process to set up the database
# RUN chmod +x /pb/start.sh
# uncomment to copy the local pb_migrations dir into the image
# COPY ./pb_migrations /pb/pb_migrations
# uncomment to copy the local pb_hooks dir into the image
# COPY ./pb_hooks /pb/pb_hooks
WORKDIR /app
COPY . .
COPY start_services.sh /app/start.sh
RUN npm ci
# RUN /pb/start.sh
EXPOSE 3000 8080
# start PocketBase
CMD ["/bin/sh", "/app/start.sh"]