Skip to content

Commit 7f66656

Browse files
committed
build: update build process
1 parent 02e26dc commit 7f66656

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ COPY package-lock.json .
77
RUN npm ci --silent
88
# Copy app files
99
COPY . ./
10+
# Args passed on build phase
11+
ARG GOOGLE_MAPS_API_KEY
12+
ARG API_HOST
13+
ENV REACT_APP_GOOGLE_MAPS_API_KEY $GOOGLE_MAPS_API_KEY
14+
ENV REACT_APP_API_HOST $API_HOST
1015
RUN npm run build
1116

1217

1318
FROM nginx:stable-alpine
1419
COPY --from=build /app/build /usr/share/nginx/html
15-
COPY env.sh /docker-entrypoint.d
16-
RUN chmod +x /docker-entrypoint.d/env.sh
1720
EXPOSE 80
1821
CMD ["nginx", "-g", "daemon off;"]

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ Maps (Google Maps)
1717
```
1818
## Docker
1919

20-
`docker compose --env-file .env up -d`
20+
`docker build -t ghcr.io/zxcv32/capture-maps-ui:main --build-arg GOOGLE_MAPS_API_KEY='<API_KEY>' --build-arg API_HOST='<host>' .`
21+
`docker compose up -d`
2122

2223
![img.png](assets/img.png)
2324

docker-compose.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,5 @@ services:
33
capture-maps-ui:
44
image: ghcr.io/zxcv32/capture-maps-ui:main
55
restart: unless-stopped
6-
environment:
7-
REACT_APP_GOOGLE_MAPS_API_KEY: "${REACT_APP_GOOGLE_MAPS_API_KEY}"
8-
REACT_APP_API_HOST: "${REACT_APP_API_HOST}"
96
ports:
107
- 9001:80

env.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)