Skip to content

Commit 455945c

Browse files
committed
Modify the name of the test image and delete the prod service in the docker-compose.yml file
1 parent 19522b0 commit 455945c

File tree

4 files changed

+14
-43
lines changed

4 files changed

+14
-43
lines changed

Docker/dev.Dockerfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@ RUN useradd -ms /bin/bash ${USERNAME}
66

77
WORKDIR ${HOME}/time-tracker-ui
88
COPY . .
9-
# RUN rm -f .env
10-
# COPY .env .
11-
RUN chown ${USERNAME}:${USERNAME} -R ${HOME}/time-tracker-ui
12-
RUN chmod -R 777 ${HOME}/time-tracker-ui
9+
RUN chown ${USERNAME}:${USERNAME} -R ${HOME}/time-tracker-ui \
10+
&& chmod -R 777 ${HOME}/time-tracker-ui
1311

1412
USER ${USERNAME}
1513
RUN npm cache clean --force && npm install
1614
EXPOSE 4200
17-
EXPOSE 9876
1815
CMD npm run config && ${HOME}/time-tracker-ui/node_modules/.bin/ng serve --host 0.0.0.0 --disableHostCheck

Docker/test.Dockerfile

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
FROM node:14 AS development
1+
FROM node:14
22

3+
ARG CHROME_VERSION=101.0.4951.54
4+
ARG CHROME_DRIVER_VERSION=2.37
35
ENV USERNAME timetracker
46
ENV HOME /home/${USERNAME}
57
ENV CHROME_BIN /opt/google/chrome/google-chrome
8+
69
#Essential tools and xvfb
710
RUN apt-get update && apt-get install -y \
811
software-properties-common \
@@ -12,7 +15,6 @@ RUN apt-get update && apt-get install -y \
1215
xvfb
1316

1417
#Chrome browser to run the tests
15-
ARG CHROME_VERSION=65.0.3325.181
1618
RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add \
1719
&& wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
1820
&& dpkg -i google-chrome-stable_current_amd64.deb || true
@@ -25,7 +27,6 @@ RUN dpkg-divert --add --rename --divert /opt/google/chrome/google-chrome.real /o
2527
&& chmod 755 /opt/google/chrome/google-chrome
2628

2729
#Chrome Driver
28-
ARG CHROME_DRIVER_VERSION=2.37
2930
RUN mkdir -p /opt/selenium \
3031
&& curl http://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip -o /opt/selenium/chromedriver_linux64.zip \
3132
&& cd /opt/selenium; unzip /opt/selenium/chromedriver_linux64.zip; rm -rf chromedriver_linux64.zip; ln -fs /opt/selenium/chromedriver /usr/local/bin/chromedriver;
@@ -34,15 +35,13 @@ RUN useradd -ms /bin/bash ${USERNAME}
3435

3536
WORKDIR ${HOME}/time-tracker-ui
3637
COPY . .
37-
RUN rm -f .env
38+
# RUN rm -f .env
3839
RUN chown ${USERNAME}:${USERNAME} -R ${HOME}/time-tracker-ui
3940
RUN chmod -R 777 ${HOME}/time-tracker-ui
4041

4142
USER ${USERNAME}
42-
RUN npm cache clean --force && npm install
43+
# COPY .env .
44+
RUN npm cache clean --force && npm install \
45+
&& npm run config && npm run test
4346
EXPOSE 4200
44-
EXPOSE 9876
45-
46-
FROM development as build
47-
COPY .env .
48-
RUN npm run config && npm run test
47+
EXPOSE 9876

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ remove: ## Delete container timetracker_ui.
4141
.PHONY: test
4242
test: ## Run all tests on docker container timetracker_ui at the CLI.
4343
docker-compose up -d timetracker_ui_test
44-
docker exec timetracker_ui bash -c "npm run ci-test"
44+
docker exec timetracker_ui_test bash -c "npm run ci-test"
4545

4646
.PHONY: testdev
4747
testdev: ## Run all tests on docker container timetracker_ui at the Dev

docker-compose.yml

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ services:
1010
- 4200:4200
1111
- 9876:9876
1212
environment:
13-
CHROME_BIN: /opt/google/chrome/google-chrome
1413
AUTHORITY: ${AUTHORITY}
1514
CLIENT_ID: ${CLIENT_ID}
1615
SCOPES: ${SCOPES}
@@ -20,37 +19,13 @@ services:
2019
AUTHORITY_JSON: ${AUTHORITY_JSON}
2120
CLIENT_ID_JSON: ${CLIENT_ID_JSON}
2221
SCOPES_JSON: ${SCOPES_JSON}
23-
24-
25-
timetracker_ui_prod:
26-
container_name: timetracker_ui_prod
27-
image: timetracker_ui_prod
28-
build:
29-
context: .
30-
dockerfile: ./Docker/prod.Dockerfile
31-
ports:
32-
- 4200:4200
33-
- 9876:9876
34-
environment:
35-
CHROME_BIN: /opt/google/chrome/google-chrome
36-
AUTHORITY: ${AUTHORITY}
37-
CLIENT_ID: ${CLIENT_ID}
38-
SCOPES: ${SCOPES}
39-
STACK_EXCHANGE_ID: ${STACK_EXCHANGE_ID}
40-
STACK_EXCHANGE_ACCESS_TOKEN: ${STACK_EXCHANGE_ACCESS_TOKEN}
41-
AZURE_APP_CONFIGURATION_CONNECTION_STRING: ${AZURE_APP_CONFIGURATION_CONNECTION_STRING}
42-
AUTHORITY_JSON: ${AUTHORITY_JSON}
43-
CLIENT_ID_JSON: ${CLIENT_ID_JSON}
44-
SCOPES_JSON: ${SCOPES_JSON}
45-
4622
timetracker_ui_test:
47-
container_name: timetracker_ui
48-
image: timetracker_ui
23+
container_name: timetracker_ui_test
24+
image: timetracker_ui_test
4925
build:
5026
context: .
5127
dockerfile: ./Docker/test.Dockerfile
5228
environment:
53-
CHROME_BIN: /opt/google/chrome/google-chrome
5429
AUTHORITY: ${AUTHORITY}
5530
CLIENT_ID: ${CLIENT_ID}
5631
SCOPES: ${SCOPES}

0 commit comments

Comments
 (0)